aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGregory Heytings2022-07-20 19:53:36 +0000
committerGregory Heytings2022-07-20 21:54:39 +0200
commite09c056a440e78afd0e1920250714bc6de6ccf4f (patch)
tree8462f7a8392874a7786d2659e96f8196295d2237
parentc7eef61eee179d127d4edeb828c723f4dee530b4 (diff)
downloademacs-feature/fix-the-long-lines-display-bug.tar.gz
emacs-feature/fix-the-long-lines-display-bug.zip
* src/xdisp.c (redisplay_window): Small optimization.feature/fix-the-long-lines-display-bug
-rw-r--r--src/xdisp.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index 4701e2b2459..2a6f32aa61f 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -19295,15 +19295,16 @@ redisplay_window (Lisp_Object window, bool just_this_one_p)
19295 && !current_buffer->long_line_optimizations_p 19295 && !current_buffer->long_line_optimizations_p
19296 && MODIFF - UNCHANGED_MODIFIED > 8) 19296 && MODIFF - UNCHANGED_MODIFIED > 8)
19297 { 19297 {
19298 ptrdiff_t cur, next, found, max = 0; 19298 ptrdiff_t cur, next, found, max = 0, threshold;
19299 threshold = XFIXNUM (Vlong_line_threshold);
19299 for (cur = 1; cur < Z; cur = next) 19300 for (cur = 1; cur < Z; cur = next)
19300 { 19301 {
19301 next = find_newline1 (cur, CHAR_TO_BYTE (cur), 0, -1, 1, 19302 next = find_newline1 (cur, CHAR_TO_BYTE (cur), 0, -1, 1,
19302 &found, NULL, true); 19303 &found, NULL, true);
19303 if (next - cur > max) max = next - cur; 19304 if (next - cur > max) max = next - cur;
19304 if (!found || max > XFIXNUM (Vlong_line_threshold)) break; 19305 if (!found || max > threshold) break;
19305 } 19306 }
19306 if (max > XFIXNUM (Vlong_line_threshold)) 19307 if (max > threshold)
19307 current_buffer->long_line_optimizations_p = true; 19308 current_buffer->long_line_optimizations_p = true;
19308 } 19309 }
19309 19310