!HCjHPBLFfoFpYNgwdE:matrix.org

Neovim dev

209 Members
Discussion about Neovim development and adjacent topics14 Servers

Load older messages


SenderMessageTime
1 Nov 2024
@ofseed:matrix.orgYiAlthough the current code isn't implemented that way, I believe the consensus I reached in the discussion with clason is an implementation of justin's proposal14:32:59
@ofseed:matrix.orgYi(I've linked the issue corresponding to this proposal in this PR)14:33:15
@lewis6991:matrix.orglewis6991Awesome. so basically if it's set in Lua, store it in Lua, and anything stored in Lua is readonly to vimscript?14:35:53
@clason:matrix.orgclasonI think not even visible (as a first step)14:36:32
@lewis6991:matrix.orglewis6991That would definitely be a braking change. It shouldn't be too hard to eval.c to read from Lua14:37:43
@clason:matrix.orgclasonno, because it would only affect things not yet supported14:38:01
@lewis6991:matrix.orglewis6991 * That would definitely be a breaking change. It shouldn't be too hard to eval.c to read from Lua14:38:04
@clason:matrix.orgclason * no, because it would only affect things not yet working at all14:38:07
@lewis6991:matrix.orglewis6991tables are supported?14:38:14
@lewis6991:matrix.orglewis6991 * tables are supported already though?14:38:23
@clason:matrix.orgclasonyes, and they would keep working?14:38:45
@clason:matrix.orgclasonthe new features are userdata and function handles14:38:54
@lewis6991:matrix.orglewis6991Does it not support functions?14:39:07
@clason:matrix.orgclasonat least that's how I understood it 14:39:07
@lewis6991:matrix.orglewis6991I thought it did?14:39:11
@clason:matrix.orgclasonI don't think so?14:39:35
@lewis6991:matrix.orglewis6991it does work, just checked14:40:05
@lewis6991:matrix.orglewis6991
14:40:17
@lewis6991:matrix.orglewis6991 *
:lua vim.g.dqwdq = function() print('ehhlo') end
14:40:26
@lewis6991:matrix.orglewis6991 *
:lua vim.g.dqwdq = function() print('ehhlo') end; vim.g.dqwdq()
14:40:55
@clason:matrix.orgclason also for vim.b? 14:41:23
@lewis6991:matrix.orglewis6991yep 14:41:37
@clason:matrix.orgclason so what is not working? 14:41:50
@lewis6991:matrix.orglewis6991thread, lol14:41:58
@lewis6991:matrix.orglewis6991 tables with metatables have working behaviour 14:42:24
@lewis6991:matrix.orglewis6991

tables with mixed keys do not work:

E5100: Cannot convert given Lua table: table should contain either only integer keys or only string keys
E5108: Error executing lua [string ":lua"]:1: Couldn't convert lua value
stack traceback:
        [C]: in function '__newindex'
        [string ":lua"]:1: in main chunk
14:43:26
@lewis6991:matrix.orglewis6991 :lua vim.b.foo = {1, a = 2} 14:43:59
@lewis6991:matrix.orglewis6991 * tables with metatables have a form ofworking behaviour 14:44:16
@lewis6991:matrix.orglewis6991 * tables with metatables have a form of working behaviour 14:44:21
@ofseed:matrix.orgYiFunctions are already supported (in fact, my implementation is based on this support). The new features are thread, userdata, and tables with a metatable. Breaking changes will occur with general tables.14:50:05

Show newer messages


Back to Room ListRoom Version: 10