neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit 12276832ab67b16f795d78c72386ab28c6ee26c7
parent 7bf04bc01fdba15c2ec55de2fe22a74683a318cf
Author: Phạm Bình An <111893501+brianhuster@users.noreply.github.com>
Date:   Mon, 14 Jul 2025 19:28:30 +0700

fix(runtime): set 'foldmethod' for Lua ftplugin #34929

Problem:
Neovim's Lua ftplugin doesn't set `'foldmethod'`, though Vim one sets it https://github.com/vim/vim/blob/1341176e7b800238b30a137c1ea1a31ca2c3d488/runtime/ftplugin/lua.vim#L66-L68

Solution:
Set it
Diffstat:
Mruntime/ftplugin/lua.lua | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/runtime/ftplugin/lua.lua b/runtime/ftplugin/lua.lua @@ -4,7 +4,8 @@ vim.treesitter.start() vim.bo.includeexpr = [[v:lua.require'vim._ftplugin.lua'.includeexpr(v:fname)]] vim.bo.omnifunc = 'v:lua.vim.lua_omnifunc' vim.wo[0][0].foldexpr = 'v:lua.vim.treesitter.foldexpr()' +vim.wo[0][0].foldmethod = 'expr' vim.b.undo_ftplugin = (vim.b.undo_ftplugin or '') .. '\n call v:lua.vim.treesitter.stop()' - .. '\n setl omnifunc< foldexpr< includeexpr<' + .. '\n setl omnifunc< foldexpr< foldmethod< includeexpr<'