From 47b748af5465201cfba710efb9ca695d2b19304b Mon Sep 17 00:00:00 2001 From: brianhuster Date: Sat, 1 Mar 2025 01:41:32 +0700 Subject: vim-patch:0b82054: runtime(lua): Improve 'include' and make '*expr' functions script-local - Prevent 'include' from matching variable assignments as calls to require() and others. - Use script-local functions for 'includeexpr' and 'foldexpr'. - Formatting fixes. closes: vim/vim#16746 https://github.com/vim/vim/commit/0b8205484b703b4a5a569cd1b0ed876bbb13901f Co-authored-by: Doug Kearns --- runtime/ftplugin/lua.vim | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'runtime') diff --git a/runtime/ftplugin/lua.vim b/runtime/ftplugin/lua.vim index 914e7ab6db..57c5887a86 100644 --- a/runtime/ftplugin/lua.vim +++ b/runtime/ftplugin/lua.vim @@ -5,7 +5,7 @@ " Contributor: Dorai Sitaram " C.D. MacEachern " Phạm Bình An -" Last Change: 2025 Feb 25 +" Last Change: 2025 Feb 27 if exists("b:did_ftplugin") finish @@ -31,11 +31,11 @@ setlocal formatoptions-=t formatoptions+=croql let &l:define = '\= 5.03 ? [ fname.'.lua', fname.'/init.lua' ] : [ fname.'.lua' ] + let paths = lua_ver >= 5.03 ? [fname .. ".lua", fname .. "/init.lua"] : [fname .. ".lua"] for path in paths if filereadable(path) return path -- cgit