mirror of
https://github.com/neovim/neovim.git
synced 2026-02-17 00:54:15 +00:00
Fix indenting nested elseifs
Currently, ``` if bool then --stuff elseif bool2 then --morestuff elseif bool3 then --more stuff else --fail end ``` Would get indented out strangely when using =. Now it behaves correctly.
This commit is contained in:
@@ -54,7 +54,7 @@ function! GetLuaIndent()
|
||||
|
||||
" Subtract a 'shiftwidth' on end, else (and elseif), until and '}'
|
||||
" This is the part that requires 'indentkeys'.
|
||||
let midx = match(getline(v:lnum), '^\s*\%(end\>\|else\>\|until\>\|}\)')
|
||||
let midx = match(getline(v:lnum), '^\s*\%(end\>\|else\>\|elseif\>\|until\>\|}\)')
|
||||
if midx != -1 && synIDattr(synID(v:lnum, midx + 1, 1), "name") != "luaComment"
|
||||
let ind = ind - &shiftwidth
|
||||
endif
|
||||
|
||||
Reference in New Issue
Block a user