[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/lua-mode 6b32777 413/468: assignment statements: unindent
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa/lua-mode 6b32777 413/468: assignment statements: unindent closing parenthesis on right hand side |
Date: |
Thu, 5 Aug 2021 04:59:20 -0400 (EDT) |
branch: elpa/lua-mode
commit 6b32777cad06eec6c80d22b2ae88778bfad15998
Author: immerrr <immerrr+lua@gmail.com>
Commit: immerrr <immerrr+lua@gmail.com>
assignment statements: unindent closing parenthesis on right hand side
---
lua-mode.el | 1 +
test/indentation-tests/assignment-indentation.lua | 60 ++++++++++++++++++++++-
test/indentation-tests/continuation-lines.lua | 56 ---------------------
3 files changed, 59 insertions(+), 58 deletions(-)
diff --git a/lua-mode.el b/lua-mode.el
index 0f45136..e280535 100644
--- a/lua-mode.el
+++ b/lua-mode.el
@@ -1657,6 +1657,7 @@ one."
;; right hand side
(or "{"
"function"
+ "("
(seq (group-n 1 (eval lua--function-name-rx) (* blank))
(any "({")))))))
diff --git a/test/indentation-tests/assignment-indentation.lua
b/test/indentation-tests/assignment-indentation.lua
index 329542a..6373c0c 100644
--- a/test/indentation-tests/assignment-indentation.lua
+++ b/test/indentation-tests/assignment-indentation.lua
@@ -75,14 +75,46 @@ local
local
x = 5
--- XFAIL: it unindents close paren for arithmetical expression
+-- indentation of function call arguments in continuation part
+
+x = foo(123,
+ 456)
+ + bar(
+ qux,
+ quux)
+
+-- does not indent binary operators inside parentheses: alignment 1
+
+x = (very_very_very_long_name() +
+ another_very_very_very_long_name())
+
+-- does not indent binary operators inside parentheses: alignment 2
+
+x = (very_very_very_long_name()
+ + another_very_very_very_long_name())
+
+-- does not indent binary operators inside parentheses: indentation 1
+
+x = (
+ very_very_very_long_name() +
+ another_very_very_very_long_name()
+)
+
+-- does not indent binary operators inside parentheses: indentation 2
+
+x = (
+ very_very_very_long_name()
+ + another_very_very_very_long_name()
+)
+
+-- it unindents close paren for arithmetical expression
a = (
foo +
bar
)
--- XFAIL: it unindents close paren for arithmetical expression: local
+-- it unindents close paren for arithmetical expression: local
local a = (
foo +
@@ -130,3 +162,27 @@ local a = myobj[
foo +
bar
]
+
+-- does not indent binary operators inside brackets: alignment 1
+
+x = t[very_very_very_long_name() +
+ another_very_very_very_long_name()]
+
+-- does not indent binary operators inside brackets: alignment 2
+
+x = t[very_very_very_long_name()
+ + another_very_very_very_long_name()]
+
+-- does not indent binary operators inside brackets: indentation 1
+
+x = [
+ very_very_very_long_name() +
+ another_very_very_very_long_name()
+ ]
+
+-- does not indent binary operators inside brackets: indentation 2
+
+x = [
+ very_very_very_long_name()
+ + another_very_very_very_long_name()
+ ]
diff --git a/test/indentation-tests/continuation-lines.lua
b/test/indentation-tests/continuation-lines.lua
index 018c27b..b3aa6d5 100644
--- a/test/indentation-tests/continuation-lines.lua
+++ b/test/indentation-tests/continuation-lines.lua
@@ -78,62 +78,6 @@ function x(...)
end
--- indentation of function call arguments in continuation part
-
-x = foo(123,
- 456)
- + bar(
- qux,
- quux)
-
--- does not indent binary operators inside parentheses: alignment 1
-
-x = (very_very_very_long_name() +
- another_very_very_very_long_name())
-
--- does not indent binary operators inside parentheses: alignment 2
-
-x = (very_very_very_long_name()
- + another_very_very_very_long_name())
-
--- does not indent binary operators inside parentheses: indentation 1
-
-x = (
- very_very_very_long_name() +
- another_very_very_very_long_name()
- )
-
--- does not indent binary operators inside parentheses: indentation 2
-
-x = (
- very_very_very_long_name()
- + another_very_very_very_long_name()
- )
-
--- does not indent binary operators inside brackets: alignment 1
-
-x = t[very_very_very_long_name() +
- another_very_very_very_long_name()]
-
--- does not indent binary operators inside brackets: alignment 2
-
-x = t[very_very_very_long_name()
- + another_very_very_very_long_name()]
-
--- does not indent binary operators inside brackets: indentation 1
-
-x = [
- very_very_very_long_name() +
- another_very_very_very_long_name()
- ]
-
--- does not indent binary operators inside brackets: indentation 2
-
-x = [
- very_very_very_long_name()
- + another_very_very_very_long_name()
- ]
-
-- indentation in block-intros: while
while
- [nongnu] elpa/lua-mode 9abad67 273/468: Merge remote-tracking branch 'upstream/master', (continued)
- [nongnu] elpa/lua-mode 9abad67 273/468: Merge remote-tracking branch 'upstream/master', Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode ec491dd 291/468: lua-process-init-code: use load when loadstring is not available, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode d7ccb88 294/468: Add new builtin functions and operators from Lua 5.3, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode c0d8c50 295/468: Merge pull request #86 from immerrr/if-loadstring-is-nil-use-load, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 3f7a032 300/468: Move .nosearch in test/, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode ca24f4c 302/468: Add `run-lua` alias, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 530aa9f 303/468: Merge pull request #97 from marsam/master, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 92d9729 307/468: Add init-tryout.el to persistent initialization code, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 04a2772 310/468: Fix goto label fontification, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode fbad628 316/468: Add travis.yml, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 6b32777 413/468: assignment statements: unindent closing parenthesis on right hand side,
Philip Kaludercic <=
- [nongnu] elpa/lua-mode 6638de0 437/468: Merge pull request #182 from immerrr/enable-ci-via-github-actions, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode a4f49d3 438/468: Consider point as inside comment if it is inside "--" opener, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 3a0fb4b 431/468: `lua-funcname-at-point': add tests, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 430679c 433/468: `lua-funcname-at-point': handle identifiers before, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 432d9a0 333/468: lua-try-match-multiline-begin: reword the comment, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode ecfe465 352/468: Remove testing for Emacs < 24.3, and add 25.2 and 25.3, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 99312b8 365/468: Merge pull request #134 from velkyel/master, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 4342dd1 372/468: Fix compatibility with new rx package from Emacs 27, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 50d94a4 373/468: tests: silence "Indenting region..." messages, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode d746b7e 381/468: Fix typos, Philip Kaludercic, 2021/08/05