runtime(lua): add/subtract a 'shiftwidth' after '('/')' in indentexpr
Problem:
- Current lua indentexpr does not indent for '(' ')'.
- Missing indent test for lua.
Solution:
- Match '(', ')' in `function GetLuaIndentIntern`.
- Add an indent test for lua.
closes: #15364
Signed-off-by: Yinzuo Jiang <jiangyinzuo@foxmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
c5bdd66558
commit
c0f7505ede
19
runtime/indent/testdir/lua.in
Normal file
19
runtime/indent/testdir/lua.in
Normal file
@ -0,0 +1,19 @@
|
||||
-- vim: set ft=lua sw=2 noet:
|
||||
|
||||
-- START_INDENT
|
||||
function foo(a, b, c, d)
|
||||
return { a, b, c, d }
|
||||
end
|
||||
|
||||
local a = foo(
|
||||
1,
|
||||
2,
|
||||
"longxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
|
||||
4
|
||||
)
|
||||
|
||||
local b = {
|
||||
1,
|
||||
2,
|
||||
}
|
||||
-- END_INDENT
|
||||
19
runtime/indent/testdir/lua.ok
Normal file
19
runtime/indent/testdir/lua.ok
Normal file
@ -0,0 +1,19 @@
|
||||
-- vim: set ft=lua sw=2 noet:
|
||||
|
||||
-- START_INDENT
|
||||
function foo(a, b, c, d)
|
||||
return { a, b, c, d }
|
||||
end
|
||||
|
||||
local a = foo(
|
||||
1,
|
||||
2,
|
||||
"longxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
|
||||
4
|
||||
)
|
||||
|
||||
local b = {
|
||||
1,
|
||||
2,
|
||||
}
|
||||
-- END_INDENT
|
||||
Reference in New Issue
Block a user