runtime(lua): indent curly bracket followed by line comment (#12306)
Commit:
https://github.com/vim/vim/commit/6633611f4280f33934c2ab9b6a3e84c04f054ad3
Author: champignoom <[email protected]>
Date: Mon Aug 21 02:49:16 2023 +0800
runtime(lua): indent curly bracket followed by line comment
(https://github.com/vim/vim/issues/12306)
fixes https://github.com/vim/vim/issues/12305
diff --git a/runtime/indent/lua.vim b/runtime/indent/lua.vim
index 0d1f934a0..ff0f64be2 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, '\<function\>\s*\%(\k\|[.:]\)\{-}\s*(')
endif
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/E1qXnef-00AtPv-5z%40256bit.org.