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)
This commit is contained in:
parent
dc8812829b
commit
2551d28fe8
1 changed files with 4 additions and 2 deletions
|
@ -20889,9 +20889,11 @@ maybe_produce_line_number (struct it *it)
|
||||||
&& it->w->base_line_pos <= IT_CHARPOS (*it)
|
&& it->w->base_line_pos <= IT_CHARPOS (*it)
|
||||||
/* line-number-mode always displays narrowed line
|
/* line-number-mode always displays narrowed line
|
||||||
numbers, so we cannot use its data if the user wants
|
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
|
&& !(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);
|
start_from = CHAR_TO_BYTE (it->w->base_line_pos);
|
||||||
last_line = it->w->base_line_number - 1;
|
last_line = it->w->base_line_number - 1;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue