diff options
| author | Eli Zaretskii | 2017-10-18 19:16:16 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2017-10-18 19:16:16 +0300 |
| commit | 2551d28fe8344e0c122489965abc6c91d65bca06 (patch) | |
| tree | feb7468a1de227e56aa1ef25cc04a7c59e52714a /src | |
| parent | dc8812829b81540d385eaa5577fa31397a8181d3 (diff) | |
| download | emacs-2551d28fe8344e0c122489965abc6c91d65bca06.tar.gz emacs-2551d28fe8344e0c122489965abc6c91d65bca06.zip | |
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)
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index b14b7daf2b0..6d9acecb424 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -20889,9 +20889,11 @@ maybe_produce_line_number (struct it *it) | |||
| 20889 | && it->w->base_line_pos <= IT_CHARPOS (*it) | 20889 | && it->w->base_line_pos <= IT_CHARPOS (*it) |
| 20890 | /* line-number-mode always displays narrowed line | 20890 | /* line-number-mode always displays narrowed line |
| 20891 | numbers, so we cannot use its data if the user wants | 20891 | numbers, so we cannot use its data if the user wants |
| 20892 | line numbers that disregard narrowing. */ | 20892 | line numbers that disregard narrowing, or if the |
| 20893 | buffer's narrowing has just changed. */ | ||
| 20893 | && !(display_line_numbers_widen | 20894 | && !(display_line_numbers_widen |
| 20894 | && (BEG_BYTE != BEGV_BYTE || Z_BYTE != ZV_BYTE))) | 20895 | && (BEG_BYTE != BEGV_BYTE || Z_BYTE != ZV_BYTE)) |
| 20896 | && !current_buffer->clip_changed) | ||
| 20895 | { | 20897 | { |
| 20896 | start_from = CHAR_TO_BYTE (it->w->base_line_pos); | 20898 | start_from = CHAR_TO_BYTE (it->w->base_line_pos); |
| 20897 | last_line = it->w->base_line_number - 1; | 20899 | last_line = it->w->base_line_number - 1; |