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

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

[nongnu] elpa/lua-mode 350acce 450/468: Don't do lua-backward-up-list ca


From: Philip Kaludercic
Subject: [nongnu] elpa/lua-mode 350acce 450/468: Don't do lua-backward-up-list calculation for overrides if not necessary
Date: Thu, 5 Aug 2021 04:59:27 -0400 (EDT)

branch: elpa/lua-mode
commit 350acced4ac44cb47653f6aeaacbf50b5519216d
Author: immerrr <immerrr+lua@gmail.com>
Commit: immerrr <immerrr+lua@gmail.com>

    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))



reply via email to

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