From 08d65696c947b09d4c32606f279c3c2594e99e16 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 1 Aug 2015 15:32:48 +0300 Subject: [PATCH] Prevent incorrect display when 'line-spacing' variable is set * src/xdisp.c (try_window_id): Give up this optimization if the buffer has its 'line-spacing' variable set non-nil. --- src/xdisp.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/xdisp.c b/src/xdisp.c index 03b03d06b3e..e45cb8702b2 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -17753,7 +17753,7 @@ try_window_id (struct window *w) #if false #define GIVE_UP(X) \ do { \ - fprintf (stderr, "try_window_id give up %d\n", (X)); \ + TRACE ((stderr, "try_window_id give up %d\n", (X))); \ return 0; \ } while (false) #else @@ -17775,7 +17775,7 @@ try_window_id (struct window *w) changed in the buffer displayed by the window, so give up if they have. */ if (w->last_overlay_modified != OVERLAY_MODIFF) - GIVE_UP (21); + GIVE_UP (200); /* Verify that narrowing has not changed. Also verify that we were not told to prevent redisplay optimizations. @@ -17835,6 +17835,11 @@ try_window_id (struct window *w) && NILP (BVAR (XBUFFER (w->contents), bidi_paragraph_direction))) GIVE_UP (22); + /* Give up if the buffer has line-spacing set, as Lisp-level changes + to that variable require thorough redisplay. */ + if (!NILP (BVAR (XBUFFER (w->contents), extra_line_spacing))) + GIVE_UP (23); + /* Make sure beg_unchanged and end_unchanged are up to date. Do it only if buffer has really changed. The reason is that the gap is initially at Z for freshly visited files. The code below would -- 2.39.2