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:
Yinzuo Jiang
2024-08-04 18:47:25 +02:00
committed by Christian Brabandt
parent c5bdd66558
commit c0f7505ede
3 changed files with 43 additions and 4 deletions

View 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

View 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