From a2d62456a7b8da27fb9b64f71b6ce588f2d73287 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 27 Aug 2022 14:06:15 +0300 Subject: [PATCH] Fix regression with cursor motion in Magit buffers * lisp/simple.el (line-move): Condition movement optimizations on presence of very long lines. (Bug#57433) --- lisp/simple.el | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/lisp/simple.el b/lisp/simple.el index ee765c8a575..d18d54ce16c 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -7717,13 +7717,15 @@ not vscroll." (not goal-column) ;; Lines aren't truncated. (not - (or truncate-lines - (and (integerp truncate-partial-width-windows) - (< (window-width) - truncate-partial-width-windows)) - (and truncate-partial-width-windows - (not (integerp truncate-partial-width-windows)) - (not (window-full-width-p))))) + (and + (or truncate-lines + (and (integerp truncate-partial-width-windows) + (< (window-total-width) + truncate-partial-width-windows)) + (and truncate-partial-width-windows + (not (integerp truncate-partial-width-windows)) + (not (window-full-width-p)))) + (long-line-optimizations-p))) ;; When the text in the window is scrolled to the left, ;; display-based motion doesn't make sense (because each ;; logical line occupies exactly one screen line). -- 2.39.2