branch: elpa/lua-mode
commit 509700fa028c6e98791d4fb4e178aca48e0e298e
Author: immerrr <[email protected]>
Commit: immerrr <[email protected]>
lua--automark-update-start-pos: rewind to beginning of line to make sure
newly inserted multiline literal delimiters are recognized
---
lua-mode.el | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lua-mode.el b/lua-mode.el
index f572833..70edb74 100644
--- a/lua-mode.el
+++ b/lua-mode.el
@@ -1308,8 +1308,10 @@ nil means automark is unnecessary because there were no
updates.")
(defun lua--automark-update-start-pos (change-begin change-end old-len)
"Updates `lua-automark-multiline-start-pos' upon buffer modification."
- (setq lua-automark-multiline-start-pos
- (or (lua-comment-or-string-start change-begin) change-begin)))
+ (save-excursion
+ (goto-char change-begin)
+ (setq lua-automark-multiline-start-pos
+ (or (lua-comment-or-string-start) (line-beginning-position)))))
(defun lua--automark-multiline-update-timer ()
(lua--automark-multiline-cleanup) ;; reset previous timer if it existed