feat(runtime): Lua ftplugin 'includeexpr' #32719

Problem:
Current `'includeexpr'` in runtime/ftplugin/lua.vim doesn't work with Nvim Lua.

Solution:
Provide an improved 'includeexpr' for Lua in "ftplugin/lua.lua".

Closes: https://github.com/neovim/neovim/issues/32490
This commit is contained in:
Phạm Bình An
2025-03-18 05:41:07 +07:00
committed by GitHub
parent 063b69bab4
commit 08c328b8b0
4 changed files with 115 additions and 1 deletions

View File

@@ -1,9 +1,10 @@
-- use treesitter over syntax
vim.treesitter.start()
vim.bo.includeexpr = 'v:lua.require"vim._ftplugin.lua".includeexpr()'
vim.bo.omnifunc = 'v:lua.vim.lua_omnifunc'
vim.wo[0][0].foldexpr = 'v:lua.vim.treesitter.foldexpr()'
vim.b.undo_ftplugin = (vim.b.undo_ftplugin or '')
.. '\n call v:lua.vim.treesitter.stop()'
.. '\n setl omnifunc< foldexpr<'
.. '\n setl omnifunc< foldexpr< includeexpr<'