File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,8 @@ let s:close_patt = '\C\%(\<\%(end\|until\)\>\|)\|}\)'
2929let s: anon_func_start = ' \S\+\s*[({].*\<function\s*(.*)\s*$'
3030let s: anon_func_end = ' \<end\%(\s*[)}]\)\+'
3131
32+ let s: chained_func_call = " ^\\ v\\ s*[:.]\\ w+[({\" ']"
33+
3234" Expression used to check whether we should skip a match with searchpair().
3335let s: skip_expr = " synIDattr(synID(line('.'),col('.'),1),'name') =~# 'luaComment\\ |luaString'"
3436
@@ -98,6 +100,16 @@ function GetLuaIndent()
98100 let i += 1
99101 endif
100102
103+ " if the current line chains a function call to previous unchained line
104+ if contents_prev !~# s: chained_func_call && contents_cur = ~# s: chained_func_call
105+ let i += 1
106+ endif
107+
108+ " if the current line chains a function call to previous unchained line
109+ if contents_prev = ~# s: chained_func_call && contents_cur !~# s: chained_func_call
110+ let i -= 1
111+ endif
112+
101113 " special case: call(with, {anon = function() -- should indent only once
102114 if i > 1 && contents_prev = ~# s: anon_func_start
103115 let i = 1
You can’t perform that action at this time.
0 commit comments