New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
something wrong with luaeval() #22863
Comments
We don't have bindeval for tables. related: #1898 . A workaround for your usecase might be to return both setter and a getter functions (closures are bound). |
This comment was marked as resolved.
This comment was marked as resolved.
are you sure? it works for me. check |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
@bfredl thanks, I fixed it in my plugin. as a workaroud for this: change the lua code in step2 to: local M = {}
function M.test() -- {{{
local a = {}
a.t = true
function a.change_t() -- {{{
a.t = false
end
function a.get_t() -- {{{
return a.t
end
-- }}}
return a
-- }}}
end
-- }}}
return M
and in step 3:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problem
when use luaeval() to get the lua value, can not change the value.
Steps to reproduce
create two files:
autoload/testl.vim
lua/testluaeval.lua
you will see
v:true
, but it should bev:false
then it works well, and you will see
false
printed.Expected behavior
in the reproduce step 3,
echo wsd.t
should bev:false
.Neovim version (nvim -v)
NVIM v0.7.0
Vim (not Nvim) behaves the same?
no
Operating system/version
win 11
Terminal name/version
neovim-qt
$TERM environment variable
empty
Installation
release page
The text was updated successfully, but these errors were encountered: