No message.
I noticed that the values are no longer correct. I am using the same
function more and the values are not refreshed. Old values are kept.
I can't remember exactly when it stopped working. I noticed it today.
I just tested with this:
variable1 = str(vim.bindeval("a:variable1"))
variable2 = str(vim.bindeval("a:variable2"))
This works.
But now it's binary isn't it (b'value')? How do I get it as text again?
Isn't there a better solution?
Thanks,
Rameo
On Tuesday, December 5, 2023 at 11:14:21 PM UTC+1 Christian Brabandt wrote:
>
> On Di, 05 Dez 2023, rameo wrote:
>
> > I installed vim 9 but still have multiple functions written in old
> vimscript.
> >
> > I've read that functions written in old vimscript still work.
> >
> > However I noticed that importing variables into Python
> `vim.eval("a:myvariable")` no longer works
> >
> > I don't always get the right values imported.
> >
> > Example :
> >
> > :call MyFunction("12", "14")
> >
> > function! MyFunction("variable1, variable2")
> > python3 << endpython
> > variable1 = vim.eval("a:variable1")
> > variable2 = vim.eval("a:variable2")
> > print(variable1 + " " + variable2)
> > endpython
> >
> > endfunction
> >
> > What's wrong in above code?
> >
> > Or better... why doesn't it work anymore in vim9?
>
> Do you get an error message? Which one? If this doesn't work anymore,
> when did it stop working?
>
> Thanks,
> Christian
> --
> Driver does not carry cash.
>
--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_use/c7057a99-f171-459a-a834-58f7ac397e1bn%40googlegroups.com.