aboutsummaryrefslogtreecommitdiff
path: root/runtime/ftplugin/lua.lua
diff options
context:
space:
mode:
authorPhạm Bình An <111893501+brianhuster@users.noreply.github.com>2025-02-23 22:57:16 +0700
committerGitHub <noreply@github.com>2025-02-23 07:57:16 -0800
commitf398e3a61abbf802b49867d2f533be1b0725c0d7 (patch)
treeaa60e7cab8688434bdd435b809a198a08dc05631 /runtime/ftplugin/lua.lua
parentb28373638848c0532bea346f48083c7e65f2d8f6 (diff)
downloadrneovim-f398e3a61abbf802b49867d2f533be1b0725c0d7.tar.gz
rneovim-f398e3a61abbf802b49867d2f533be1b0725c0d7.tar.bz2
rneovim-f398e3a61abbf802b49867d2f533be1b0725c0d7.zip
feat(ftplugin): set Lua 'omnifunc' to vim.lua_omnifunc #32491
Problem: - Many other ftplugin have defined 'omnifunc', but the Lua one doesn't define one, even though there is `vim.lua_omnifunc()` - Users may want "stupid" completion to fix Lua config with `nvim --clean` in case they breaks it Solution: Set 'omnifunc' to 'v:lua.vim.lua_omnifunc' in ftplugin/lua.lua
Diffstat (limited to 'runtime/ftplugin/lua.lua')
-rw-r--r--runtime/ftplugin/lua.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/runtime/ftplugin/lua.lua b/runtime/ftplugin/lua.lua
index 75deb6b190..e2a7631b29 100644
--- a/runtime/ftplugin/lua.lua
+++ b/runtime/ftplugin/lua.lua
@@ -1,4 +1,7 @@
-- use treesitter over syntax
vim.treesitter.start()
-vim.b.undo_ftplugin = (vim.b.undo_ftplugin or '') .. '\n call v:lua.vim.treesitter.stop()'
+vim.bo.omnifunc = 'v:lua.vim.lua_omnifunc'
+
+vim.b.undo_ftplugin = (vim.b.undo_ftplugin or '')
+ .. '\n call v:lua.vim.treesitter.stop() \n setl omnifunc<'