Commit 2551d28f authored by Eli Zaretskii's avatar Eli Zaretskii

Fix line number display after 'widen'

* 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)
parent dc881282
......@@ -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;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment