emacs-elpa-diffs
[Top][All Lists]
Advanced

[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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]