aboutsummaryrefslogtreecommitdiff
path: root/runtime/ftplugin/lua.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2026-07-29 19:09:48 +0200
committerJustin M. Keyes <justinkz@gmail.com>2026-07-31 21:50:04 +0200
commit726d1a92d243a8b7cb4b221d64e4523b7a89aaf4 (patch)
treeae28d691f0a49f59f61e283e2c220563c49a18c0 /runtime/ftplugin/lua.lua
parent917232b50875cfa1ef262b2f6d61b648fdd68102 (diff)
downloadrneovim-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/ftplugin/lua.lua')
-rw-r--r--runtime/ftplugin/lua.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/runtime/ftplugin/lua.lua b/runtime/ftplugin/lua.lua
index 7c54b2cb1e..914c4f8d4c 100644
--- a/runtime/ftplugin/lua.lua
+++ b/runtime/ftplugin/lua.lua
@@ -2,7 +2,7 @@
vim.treesitter.start()
vim.bo.includeexpr = [[v:lua.require'vim._ftplugin.lua'.includeexpr(v:fname)]]
-vim.bo.omnifunc = 'v:lua.vim.lua_omnifunc'
+vim.bo.omnifunc = vim.lua_omnifunc
vim.wo[0][0].foldexpr = 'v:lua.vim.treesitter.foldexpr()'
vim.b.undo_ftplugin = (vim.b.undo_ftplugin or '')