branch: elpa/lua-mode
commit 0715340d23000bf49beb57a70d5b50adc2c151e2
Merge: d759699 dccda19
Author: dennis again <[email protected]>
Commit: GitHub <[email protected]>

    Merge pull request #131 from jorams/fill-paragraph-save-excursion
    
    Wrap lua--fill-paragraph in save-excursion
---
 lua-mode.el | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/lua-mode.el b/lua-mode.el
index 8137619..8f236af 100644
--- a/lua-mode.el
+++ b/lua-mode.el
@@ -810,12 +810,13 @@ Groups 6-9 can be used in any of argument regexps."
   ;; does not find a comment at the beginning of the empty line before the
   ;; comment and falls back to text-based filling ignoring comment-start and
   ;; spilling the comment into the code.
-  (while (and (not (eobp))
-              (progn (move-to-left-margin)
-                     (looking-at paragraph-separate)))
-    (forward-line 1))
-  (let ((fill-paragraph-handle-comment t))
-    (fill-paragraph justify region)))
+  (save-excursion
+    (while (and (not (eobp))
+                (progn (move-to-left-margin)
+                       (looking-at paragraph-separate)))
+      (forward-line 1))
+    (let ((fill-paragraph-handle-comment t))
+      (fill-paragraph justify region))))
 
 
 (defun lua-prefix-key-update-bindings ()

Reply via email to