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

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

[nongnu] elpa/scroll-on-drag be3c43b74e 21/35: Fix restoring the point w


From: ELPA Syncer
Subject: [nongnu] elpa/scroll-on-drag be3c43b74e 21/35: Fix restoring the point with mixed tabs/spaces
Date: Thu, 7 Jul 2022 12:02:50 -0400 (EDT)

branch: elpa/scroll-on-drag
commit be3c43b74e366bf1d6afe0fdea7830fb7d5cf622
Author: Campbell Barton <ideasman42@gmail.com>
Commit: Campbell Barton <ideasman42@gmail.com>

    Fix restoring the point with mixed tabs/spaces
---
 scroll-on-drag.el | 19 +++----------------
 1 file changed, 3 insertions(+), 16 deletions(-)

diff --git a/scroll-on-drag.el b/scroll-on-drag.el
index c956e3561c..cd91918b85 100644
--- a/scroll-on-drag.el
+++ b/scroll-on-drag.el
@@ -201,12 +201,7 @@ Returns true when scrolling took place, otherwise nil."
       (restore-x-pointer-shape (and (boundp 'x-pointer-shape) x-pointer-shape))
 
       ;; Restore indent (lost when scrolling).
-      (restore-indent
-        (-
-          (point)
-          (save-excursion
-            (back-to-indentation)
-            (point))))
+      (restore-column (current-column))
 
       (mouse-y-fn
         (cond
@@ -417,16 +412,8 @@ Returns true when scrolling took place, otherwise nil."
       (setq has-scrolled nil))
 
     ;; Restore indent level if possible.
-    (when (and has-scrolled (> restore-indent 0))
-      (move-beginning-of-line nil)
-      (right-char
-        (min
-          restore-indent
-          (-
-            (save-excursion
-              (move-end-of-line nil)
-              (point))
-            (point)))))
+    (when (and has-scrolled (> restore-column 0))
+      (move-to-column restore-column))
 
     ;; Restore pointer.
     (when (boundp 'x-pointer-shape)



reply via email to

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