mirror of
https://github.com/neovim/neovim.git
synced 2026-08-02 05:39:12 +00:00
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>
This commit is contained in:
@@ -768,7 +768,7 @@ function M.open_page(count, smods, args)
|
||||
end
|
||||
local buf = api.nvim_get_current_buf()
|
||||
local save_tfu = vim.bo[buf].tagfunc
|
||||
vim.bo[buf].tagfunc = "v:lua.require'man'.goto_tag"
|
||||
vim.bo[buf].tagfunc = M.goto_tag
|
||||
|
||||
local target = ('%s(%s)'):format(name, sect)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user