mirror of
https://github.com/neovim/neovim.git
synced 2026-08-29 10:31:48 +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:
@@ -1981,7 +1981,7 @@ void insertchar(int c, int flags, int second_indent)
|
||||
colnr_T virtcol = get_nolist_virtcol()
|
||||
+ char2cells(c != NUL ? c : gchar_cursor());
|
||||
|
||||
if (*curbuf->b_p_fex != NUL && (flags & INSCHAR_NO_FEX) == 0
|
||||
if (curbuf->b_p_fex.type != kCallbackNone && (flags & INSCHAR_NO_FEX) == 0
|
||||
&& (force_format || virtcol > (colnr_T)textwidth)) {
|
||||
do_internal = (fex_format(curwin->w_cursor.lnum, 1, c) != 0);
|
||||
// It may be required to save for undo again, e.g. when setline()
|
||||
|
||||
Reference in New Issue
Block a user