[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/scroll-on-drag 494de949d5 04/35: Restore indent level
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/scroll-on-drag 494de949d5 04/35: Restore indent level |
Date: |
Thu, 7 Jul 2022 12:02:43 -0400 (EDT) |
branch: elpa/scroll-on-drag
commit 494de949d517c4d2345d4ac3cd62cb67e0483318
Author: Campbell Barton <ideasman42@gmail.com>
Commit: Campbell Barton <ideasman42@gmail.com>
Restore indent level
---
scroll-on-drag.el | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/scroll-on-drag.el b/scroll-on-drag.el
index 56af588e18..d46c493cee 100644
--- a/scroll-on-drag.el
+++ b/scroll-on-drag.el
@@ -92,6 +92,9 @@
(restore-window-start (window-start))
(restore-point (point))
+ ;; Restore indent (lost when scrolling).
+ (restore-indent (- (point) (save-excursion (back-to-indentation)
(point))))
+
(mouse-y-fn
(cond
((eq scroll-on-drag-style 'line)
@@ -317,6 +320,14 @@
(funcall timer-stop-fn)
+ ;; 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)))))
+
;; Result so we know if any scrolling occurred,
;; allowing a fallback action on 'click'.
has-scrolled))
- [nongnu] branch elpa/scroll-on-drag created (now 01c14f4c02), ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-drag f07ea06555 13/35: Cleanup: style, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-drag 42d96a60a2 22/35: Cleanup: simplify some logic using 'line-beginning-position', ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-drag ad94790492 24/35: readme: link to melpa, tweak title level, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-drag 31f322554d 31/35: Cleanup: move force-redisplay into an inline function, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-drag d93b69eed6 33/35: Cleanup: use brief SPDX license, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-drag 64445dd96f 15/35: Apply auto-formatting, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-drag a717d58f31 01/35: Add license file, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-drag a668537a8d 02/35: Initial modal scroll, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-drag 494de949d5 04/35: Restore indent level,
ELPA Syncer <=
- [nongnu] elpa/scroll-on-drag 6cf8c0d81e 06/35: Enable smooth scrolling by default, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-drag 888abd04c3 09/35: Add melpa link, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-drag d8582732d1 29/35: Scroll the window under the mouse cursor, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-drag 31c3baed1d 08/35: Check x-pointer-shape is available before setting, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-drag fa6a293c74 14/35: Correct macro, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-drag 81623ccc59 10/35: Add pre/post hooks, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-drag fb9af98461 34/35: Change URL to codeberg, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-drag d6257b2fb7 05/35: Prevent cursor changing over text, ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-drag 823aab7938 27/35: Cleanup: replace 'if' with 'cond', ELPA Syncer, 2022/07/07
- [nongnu] elpa/scroll-on-drag be3c43b74e 21/35: Fix restoring the point with mixed tabs/spaces, ELPA Syncer, 2022/07/07