]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix line number display after 'widen'
authorEli Zaretskii <eliz@gnu.org>
Wed, 18 Oct 2017 16:16:16 +0000 (19:16 +0300)
committerEli Zaretskii <eliz@gnu.org>
Wed, 18 Oct 2017 16:16:16 +0000 (19:16 +0300)
* src/xdisp.c (maybe_produce_line_number): Don't use data cached
by line-number-mode on the first redisplay after the buffer is
widened.  (Bug#28879)

src/xdisp.c

index b14b7daf2b0c4f0b78ead5c83ba69df05153e8aa..6d9acecb424c58f221c6db47f758a5efd5b9ef2b 100644 (file)
@@ -20889,9 +20889,11 @@ maybe_produce_line_number (struct it *it)
              && it->w->base_line_pos <= IT_CHARPOS (*it)
              /* line-number-mode always displays narrowed line
                 numbers, so we cannot use its data if the user wants
-                line numbers that disregard narrowing.  */
+                line numbers that disregard narrowing, or if the
+                buffer's narrowing has just changed.  */
              && !(display_line_numbers_widen
-                  && (BEG_BYTE != BEGV_BYTE || Z_BYTE != ZV_BYTE)))
+                  && (BEG_BYTE != BEGV_BYTE || Z_BYTE != ZV_BYTE))
+             && !current_buffer->clip_changed)
            {
              start_from = CHAR_TO_BYTE (it->w->base_line_pos);
              last_line = it->w->base_line_number - 1;