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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/lua-mode a1f6d28 385/468: added lua-indent-close-paren-ali


From: Philip Kaludercic
Subject: [nongnu] elpa/lua-mode a1f6d28 385/468: added lua-indent-close-paren-align var
Date: Thu, 5 Aug 2021 04:59:14 -0400 (EDT)

branch: elpa/lua-mode
commit a1f6d28c5d4f392b9f180934804f57bbcb47c262
Author: edam <tim@ed.am>
Commit: edam <tim@ed.am>

    added lua-indent-close-paren-align var
---
 lua-mode.el | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/lua-mode.el b/lua-mode.el
index ed8484d..aecd35e 100644
--- a/lua-mode.el
+++ b/lua-mode.el
@@ -55,6 +55,9 @@
 ;; - Var `lua-indent-nested-block-content-align':
 ;;   set to `nil' to stop aligning the content of nested blocks with the
 ;;   open parenthesis
+;; - Var `lua-indent-close-paren-align':
+;;   set to `t' to align close parenthesis with the open parenthesis,
+;;   rather than with the beginning of the line
 ;; - Var `lua-mode-hook':
 ;;   list of functions to execute when lua-mode is initialized
 ;; - Var `lua-documentation-url':
@@ -369,6 +372,13 @@ just forward by `lua-indent-level'."
   :group 'lua
   :type 'boolean)
 
+(defcustom lua-indent-close-paren-align t
+  "If non-nil, close parenthesis are aligned with their open
+parenthesis.  If nil, close parenthesis are aligned to the
+beginning of the line."
+  :group 'lua
+  :type 'boolean)
+
 (defcustom lua-jump-on-traceback t
   "*Jump to innermost traceback location in *lua* buffer.  When this
 variable is non-nil and a traceback occurs when running Lua code in a
@@ -1548,7 +1558,8 @@ If not, return nil."
         (when (lua-goto-matching-block-token block-token-pos 'backward)
           ;; Exception cases: when the start of the line is an assignment,
           ;; go to the start of the assignment instead of the matching item
-          (if (lua-point-is-after-left-shifter-p)
+          (if (or (not lua-indent-close-paren-align)
+                  (lua-point-is-after-left-shifter-p))
               (current-indentation)
             (current-column)))))))
 



reply via email to

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