branch: elpa/lua-mode
commit 350acced4ac44cb47653f6aeaacbf50b5519216d
Author: immerrr <[email protected]>
Commit: immerrr <[email protected]>
Don't do lua-backward-up-list calculation for overrides if not necessary
---
lua-mode.el | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/lua-mode.el b/lua-mode.el
index 018184a..be05848 100644
--- a/lua-mode.el
+++ b/lua-mode.el
@@ -1823,12 +1823,13 @@ If not, return nil."
;; hello_world()
;; end
(setq opener-pos (point))
- (unless (or
- (and (string-equal (car opener-info) "do")
- (member (car (lua--backward-up-list-noerror)) '("while"
"for")))
- (and (string-equal (car opener-info) "then")
- (member (car (lua--backward-up-list-noerror)) '("if"
"elseif"))))
- (goto-char opener-pos))
+ (when (/= (- opener-pos (line-beginning-position))
(current-indentation))
+ (unless (or
+ (and (string-equal (car opener-info) "do")
+ (member (car (lua--backward-up-list-noerror))
'("while" "for")))
+ (and (string-equal (car opener-info) "then")
+ (member (car (lua--backward-up-list-noerror)) '("if"
"elseif"))))
+ (goto-char opener-pos)))
;; (let (cont-stmt-pos)
;; (while (setq cont-stmt-pos (lua-is-continuing-statement-p))