diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2026-07-29 19:09:48 +0200 |
|---|---|---|
| committer | Justin M. Keyes <justinkz@gmail.com> | 2026-07-31 21:50:04 +0200 |
| commit | 726d1a92d243a8b7cb4b221d64e4523b7a89aaf4 (patch) | |
| tree | ae28d691f0a49f59f61e283e2c220563c49a18c0 /runtime/lua/vim/treesitter/dev.lua | |
| parent | 917232b50875cfa1ef262b2f6d61b648fdd68102 (diff) | |
| download | rneovim-726d1a92d243a8b7cb4b221d64e4523b7a89aaf4.tar.gz rneovim-726d1a92d243a8b7cb4b221d64e4523b7a89aaf4.tar.bz2 rneovim-726d1a92d243a8b7cb4b221d64e4523b7a89aaf4.zip | |
feat(options): lua closure/function options
Problem:
Cannot assign Lua functions/closures to "func" ('completefunc',
'tagfun', …) or "expr" ('foldexpr', 'indentexpr', …) options.
Solution:
- Store "func"/"expr" options as `Callback` instead of string.
- Delete oceans of copy-pasted code.
- BREAKING: LuaRef returned via RPC/Vimscript is now represented as
`"<Lua N: file:line>"` (like what `:map` shows) instead of `nil`.
- Note: `man.vim` still uses `v:lua` string, bc it's a vimscript ftplugin.
Helped-by: Lewis Russell <lewis6991@gmail.com>
Diffstat (limited to 'runtime/lua/vim/treesitter/dev.lua')
| -rw-r--r-- | runtime/lua/vim/treesitter/dev.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/runtime/lua/vim/treesitter/dev.lua b/runtime/lua/vim/treesitter/dev.lua index dc7a73432d..32cd13ae3d 100644 --- a/runtime/lua/vim/treesitter/dev.lua +++ b/runtime/lua/vim/treesitter/dev.lua @@ -639,7 +639,7 @@ function M.edit_query(lang) local query_buf = api.nvim_win_get_buf(query_win) vim.b[buf].dev_edit = query_win - vim.bo[query_buf].omnifunc = 'v:lua.vim.treesitter.query.omnifunc' + vim.bo[query_buf].omnifunc = vim.treesitter.query.omnifunc set_dev_options(query_win, query_buf) -- Note that omnifunc guesses the language based on the containing folder, |