Skip to content

Commit 1068951

Browse files
author
Tim Marston
committed
added lua-indent-close-paren-align var
1 parent aee46da commit 1068951

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

lua-mode.el

+12-1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@
5555
;; - Var `lua-indent-nested-block-content-align':
5656
;; set to `nil' to stop aligning the content of nested blocks with the
5757
;; open parenthesis
58+
;; - Var `lua-indent-close-paren-align':
59+
;; set to `t' to align close parenthesis with the open parenthesis,
60+
;; rather than with the beginning of the line
5861
;; - Var `lua-mode-hook':
5962
;; list of functions to execute when lua-mode is initialized
6063
;; - Var `lua-documentation-url':
@@ -369,6 +372,13 @@ just forward by `lua-indent-level'."
369372
:group 'lua
370373
:type 'boolean)
371374

375+
(defcustom lua-indent-close-paren-align t
376+
"If non-nil, close parenthesis are aligned with their open
377+
parenthesis. If nil, close parenthesis are aligned to the
378+
beginning of the line."
379+
:group 'lua
380+
:type 'boolean)
381+
372382
(defcustom lua-jump-on-traceback t
373383
"*Jump to innermost traceback location in *lua* buffer. When this
374384
variable is non-nil and a traceback occurs when running Lua code in a
@@ -1548,7 +1558,8 @@ If not, return nil."
15481558
(when (lua-goto-matching-block-token block-token-pos 'backward)
15491559
;; Exception cases: when the start of the line is an assignment,
15501560
;; go to the start of the assignment instead of the matching item
1551-
(if (lua-point-is-after-left-shifter-p)
1561+
(if (or (not lua-indent-close-paren-align)
1562+
(lua-point-is-after-left-shifter-p))
15521563
(current-indentation)
15531564
(current-column)))))))
15541565

0 commit comments

Comments
 (0)