diff --git a/lua-mode.el b/lua-mode.el index e2e1ac7..d32f0c3 100644 --- a/lua-mode.el +++ b/lua-mode.el @@ -230,6 +230,15 @@ for Emacsen that doesn't contain one (pre-23.3)." :type 'integer :group 'lua) +(defcustom lua-hanging-indent-level 3 + "Amount by which Lua line continuations are indented. This +affects multi-line statements in general, including lines +following an (, [ or { character at the end of the line, but not +those with an opening paren followed by non-whitespace characters +on the same line." + :type 'integer + :group 'lua) + (defcustom lua-comment-start "-- " "Default value of `comment-start'." :type 'string @@ -1314,7 +1323,7 @@ use standalone." (if (and (zerop (count-lines found-bol (line-beginning-position))) (not (looking-at lua-indentation-modifier-regexp))) (cons 'absolute (current-column)) - (cons 'relative lua-indent-level))))) + (cons 'relative lua-hanging-indent-level))))) ;; These are not really block starters. They should not add to indentation. ;; The corresponding "then" and "do" handle the indentation. @@ -1437,7 +1446,8 @@ and relative each, and the shift/column to indent to." (if (lua-is-continuing-statement-p) ;; if it's the first continuation line, add one level (unless (eq (car (car indentation-info)) 'continued-line) - (push (cons 'continued-line lua-indent-level) indentation-info)) + (push (cons 'continued-line lua-hanging-indent-level) + indentation-info)) ;; if it's the first non-continued line, subtract one level (when (eq (car (car indentation-info)) 'continued-line)