mirror of
https://github.com/neovim/neovim.git
synced 2026-08-02 13:49:19 +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:
@@ -1448,10 +1448,10 @@ end
|
||||
--- Reset defaults set by `set_defaults`.
|
||||
--- Must only be called if the last client attached to a buffer exits.
|
||||
local function reset_defaults(bufnr)
|
||||
if vim.bo[bufnr].tagfunc == 'v:lua.vim.lsp.tagfunc' then
|
||||
if vim.bo[bufnr].tagfunc == vim.lsp.tagfunc then
|
||||
vim.bo[bufnr].tagfunc = nil
|
||||
end
|
||||
if vim.bo[bufnr].omnifunc == 'v:lua.vim.lsp.omnifunc' then
|
||||
if vim.bo[bufnr].omnifunc == vim.lsp.omnifunc then
|
||||
vim.bo[bufnr].omnifunc = nil
|
||||
end
|
||||
if vim.bo[bufnr].formatexpr == 'v:lua.vim.lsp.formatexpr()' then
|
||||
|
||||
Reference in New Issue
Block a user