[Top][All Lists]

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

[elpa] externals/vlf 9fad430 066/310: Fix positioning after save.

From: Stefan Monnier
Subject: [elpa] externals/vlf 9fad430 066/310: Fix positioning after save.
Date: Sat, 28 Nov 2020 00:32:48 -0500 (EST)

branch: externals/vlf
commit 9fad4306012778874760211da766da0433dd00e5
Author: Andrey Kotlarski <m00naticus@gmail.com>
Commit: Andrey Kotlarski <m00naticus@gmail.com>

    Fix positioning after save.
 vlfi.el | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/vlfi.el b/vlfi.el
index 52d4af2..581d50e 100644
--- a/vlfi.el
+++ b/vlfi.el
@@ -459,18 +459,18 @@ If changing size of chunk shift remaining file content."
              (or (verify-visited-file-modtime)
                  (y-or-n-p "File has changed since visited or saved.  \
 Save anyway? ")))
-    (let ((size-change (- vlfi-end-pos vlfi-start-pos
+    (let ((pos (point))
+          (size-change (- vlfi-end-pos vlfi-start-pos
                           (length (encode-coding-region
                                    (point-min) (point-max)
-                                   buffer-file-coding-system t))))
-          (pos (point)))
+                                   buffer-file-coding-system t)))))
       (cond ((zerop size-change)
              (write-region nil nil buffer-file-name vlfi-start-pos t))
             ((< 0 size-change)
              (vlfi-file-shift-back size-change))
             (t (vlfi-file-shift-forward (- size-change))))
+      (vlfi-move-to-chunk vlfi-start-pos vlfi-end-pos)
       (goto-char pos))
-    (vlfi-move-to-chunk vlfi-start-pos vlfi-end-pos)

reply via email to

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