From 57a978fd74454392a041ac65a5abba8d012b88cc Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 23 Jul 2022 18:57:06 +0300 Subject: [PATCH] Optimize 'set_vertical_scroll_bar' for long lines * src/xdisp.c (set_vertical_scroll_bar): Don't bother being accurate about window_end_pos if long-line shortcuts are in effect in the current buffer. --- src/xdisp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/xdisp.c b/src/xdisp.c index c507d0caf20..c73958854cd 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -18968,8 +18968,9 @@ set_vertical_scroll_bar (struct window *w) ptrdiff_t window_end_pos = w->window_end_pos; /* If w->window_end_pos cannot be trusted, recompute it "the - hard way". */ - if (!w->window_end_valid) + hard way". But don't bother to be too accurate when + long-line shortcuts are in effect. */ + if (!w->window_end_valid && !buf->long_line_optimizations_p) { struct it it; struct text_pos start_pos; -- 2.39.5