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

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

[elpa] externals/vlf 9e27aeb 021/310: Keep stable cursor position when m


From: Stefan Monnier
Subject: [elpa] externals/vlf 9e27aeb 021/310: Keep stable cursor position when moving through chunks.
Date: Sat, 28 Nov 2020 00:32:39 -0500 (EST)

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

    Keep stable cursor position when moving through chunks.
---
 vlfi.el | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/vlfi.el b/vlfi.el
index 431b5c0..3d7a55e 100644
--- a/vlfi.el
+++ b/vlfi.el
@@ -121,7 +121,8 @@ When prefix argument is negative
             ((< vlfi-file-size end)
              (setq end vlfi-file-size))))
     (let ((inhibit-read-only t)
-          (do-append (< append 0)))
+          (do-append (< append 0))
+          (pos (point)))
       (if do-append
           (goto-char (point-max))
         (setq vlfi-start-pos (- end vlfi-batch-size))
@@ -130,7 +131,8 @@ When prefix argument is negative
                             (if do-append
                                 vlfi-end-pos
                               vlfi-start-pos)
-                            end))
+                            end)
+      (goto-char pos))
     (setq vlfi-end-pos end))
   (set-buffer-modified-p nil)
   (vlfi-update-buffer-name))
@@ -147,7 +149,8 @@ When prefix argument is negative
   (let ((inhibit-read-only t)
         (start (max 0 (- vlfi-start-pos (* vlfi-batch-size
                                            (abs prepend)))))
-        (do-prepend (< prepend 0)))
+        (do-prepend (< prepend 0))
+        (pos (- (point-max) (point))))
     (if do-prepend
         (goto-char (point-min))
       (setq vlfi-end-pos (+ start vlfi-batch-size))
@@ -156,6 +159,7 @@ When prefix argument is negative
                           (if do-prepend
                               vlfi-start-pos
                             vlfi-end-pos))
+    (goto-char (- (point-max) pos))
     (setq vlfi-start-pos start))
   (set-buffer-modified-p nil)
   (vlfi-update-buffer-name))



reply via email to

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