From 3f877657dd1be891bdf6b5fa79d92319b720426d Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Mon, 21 Aug 2023 09:51:59 +0900 Subject: vim-patch:6633611f4280 runtime(lua): indent curly bracket followed by line comment (vim/vim#12306) fixes vim/vim#12305 https://github.com/vim/vim/commit/6633611f4280f33934c2ab9b6a3e84c04f054ad3 Co-authored-by: champignoom <66909116+champignoom@users.noreply.github.com> --- runtime/indent/lua.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime/indent/lua.vim') diff --git a/runtime/indent/lua.vim b/runtime/indent/lua.vim index 0d1f934a03..ff0f64be29 100644 --- a/runtime/indent/lua.vim +++ b/runtime/indent/lua.vim @@ -41,7 +41,7 @@ function! GetLuaIndent() let prevline = getline(prevlnum) let midx = match(prevline, '^\s*\%(if\>\|for\>\|while\>\|repeat\>\|else\>\|elseif\>\|do\>\|then\>\)') if midx == -1 - let midx = match(prevline, '{\s*$') + let midx = match(prevline, '{\s*\%(--\%([^[].*\)\?\)\?$') if midx == -1 let midx = match(prevline, '\\s*\%(\k\|[.:]\)\{-}\s*(') endif -- cgit From c9764bf331b4238ea60af382b013e0d058318d58 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Mon, 21 Aug 2023 09:52:42 +0900 Subject: vim-patch:9fa35b1c38b8 runtime(lua): fix lua indentation of non-lowercase "keywords" (vim/vim#11759) https://github.com/vim/vim/commit/9fa35b1c38b84d95b5c8e083aa742e0e0490fa1f Co-authored-by: beardedsakimonkey <54521218+beardedsakimonkey@users.noreply.github.com> --- runtime/indent/lua.vim | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'runtime/indent/lua.vim') diff --git a/runtime/indent/lua.vim b/runtime/indent/lua.vim index ff0f64be29..35b08d4037 100644 --- a/runtime/indent/lua.vim +++ b/runtime/indent/lua.vim @@ -27,6 +27,16 @@ if exists("*GetLuaIndent") endif function! GetLuaIndent() + let ignorecase_save = &ignorecase + try + let &ignorecase = 0 + return GetLuaIndentIntern() + finally + let &ignorecase = ignorecase_save + endtry +endfunction + +function! GetLuaIndentIntern() " Find a non-blank line above the current line. let prevlnum = prevnonblank(v:lnum - 1) -- cgit