]> git.eshelyaron.com Git - emacs.git/commitdiff
Improve the heuristic for long lines detection again.
authorGregory Heytings <gregory@heytings.org>
Tue, 19 Jul 2022 13:33:38 +0000 (13:33 +0000)
committerGregory Heytings <gregory@heytings.org>
Tue, 19 Jul 2022 13:35:14 +0000 (15:35 +0200)
* src/xdisp.c (redisplay_window): Improve the heuristic again.

src/xdisp.c

index 05fb008ff1573a538d37774bc6c4ccca66bfdb88..ee34487a444cb0497602df7c1a391bcfaaa6719d 100644 (file)
@@ -19294,7 +19294,9 @@ redisplay_window (Lisp_Object window, bool just_this_one_p)
   /* Check whether the buffer to be displayed contains long lines.  */
   if (!NILP (Vlong_line_threshold)
       && !current_buffer->long_line_optimizations_p
-      && Z - BEG - BUF_UNCHANGED_SIZE (current_buffer) <= 1)
+      && (MODIFF - UNCHANGED_MODIFIED > 4
+         || Z - BEG - BUF_UNCHANGED_SIZE (current_buffer) > 1
+         || Z - BEG - BUF_UNCHANGED_SIZE (current_buffer) < -1))
     {
       ptrdiff_t cur, next, found, max = 0;
       for (cur = 1; cur < Z; cur = next)