1 Nov 2024 |
Yi | Although 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 proposal | 14:32:59 |
Yi | (I've linked the issue corresponding to this proposal in this PR) | 14:33:15 |
lewis6991 | Awesome. 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 | I think not even visible (as a first step) | 14:36:32 |
lewis6991 | That would definitely be a braking change. It shouldn't be too hard to eval.c to read from Lua | 14:37:43 |
clason | no, because it would only affect things not yet supported | 14:38:01 |
lewis6991 | * That would definitely be a breaking change. It shouldn't be too hard to eval.c to read from Lua | 14:38:04 |
clason | * no, because it would only affect things not yet working at all | 14:38:07 |
lewis6991 | tables are supported? | 14:38:14 |
lewis6991 | * tables are supported already though? | 14:38:23 |
clason | yes, and they would keep working? | 14:38:45 |
clason | the new features are userdata and function handles | 14:38:54 |
lewis6991 | Does it not support functions? | 14:39:07 |
clason | at least that's how I understood it | 14:39:07 |
lewis6991 | I thought it did? | 14:39:11 |
clason | I don't think so? | 14:39:35 |
lewis6991 | it does work, just checked | 14:40:05 |
lewis6991 |
| 14:40:17 |
lewis6991 | * :lua vim.g.dqwdq = function() print('ehhlo') end
| 14:40:26 |
lewis6991 | * :lua vim.g.dqwdq = function() print('ehhlo') end; vim.g.dqwdq()
| 14:40:55 |
clason | also for vim.b ? | 14:41:23 |
lewis6991 | yep
| 14:41:37 |
clason | so what is not working? | 14:41:50 |
lewis6991 | thread, lol | 14:41:58 |
lewis6991 | tables with metatables have working behaviour | 14:42:24 |
lewis6991 | 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 | :lua vim.b.foo = {1, a = 2} | 14:43:59 |
lewis6991 | * tables with metatables have a form ofworking behaviour | 14:44:16 |
lewis6991 | * tables with metatables have a form of working behaviour | 14:44:21 |
Yi | Functions 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 |