aboutsummaryrefslogtreecommitdiffstats
path: root/src/window.c
diff options
context:
space:
mode:
authorEli Zaretskii2022-01-13 14:21:10 +0200
committerEli Zaretskii2022-01-13 14:21:10 +0200
commit8ec475e558dcd0ebde213d8a73f09574e8b4d00a (patch)
tree71e284837051b6872efc885791f7326d93a1784f /src/window.c
parent50654cf0b1bf6210fc8f46d8e7ae13bbeeccecb5 (diff)
downloademacs-8ec475e558dcd0ebde213d8a73f09574e8b4d00a.tar.gz
emacs-8ec475e558dcd0ebde213d8a73f09574e8b4d00a.zip
Improve preserving X coordinate during scroll commands
* src/window.c (window_scroll_pixel_based): Don't unnecessarily move the iterator. (Bug#53220)
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/window.c b/src/window.c
index 7155f0e6bc3..2a5e4042a48 100644
--- a/src/window.c
+++ b/src/window.c
@@ -5861,7 +5861,8 @@ window_scroll_pixel_based (Lisp_Object window, int n, bool whole, bool noerror)
5861 5861
5862 /* We moved the window start towards ZV, so PT may be now 5862 /* We moved the window start towards ZV, so PT may be now
5863 in the scroll margin at the top. */ 5863 in the scroll margin at the top. */
5864 move_it_to (&it, PT, -1, -1, -1, MOVE_TO_POS); 5864 if (IT_CHARPOS (it) < PT)
5865 move_it_to (&it, PT, -1, -1, -1, MOVE_TO_POS);
5865 if (IT_CHARPOS (it) == PT 5866 if (IT_CHARPOS (it) == PT
5866 && it.current_y >= this_scroll_margin 5867 && it.current_y >= this_scroll_margin
5867 && it.current_y <= last_y - WINDOW_TAB_LINE_HEIGHT (w) 5868 && it.current_y <= last_y - WINDOW_TAB_LINE_HEIGHT (w)