diff options
| author | Gregory Heytings | 2022-07-18 15:50:57 +0000 |
|---|---|---|
| committer | Gregory Heytings | 2022-07-18 17:54:55 +0200 |
| commit | 1ff69cc744eaa704afc1ff81242d41a6c09439fe (patch) | |
| tree | 3355dbbb1715b0661b1b0e7beaf5b0ef20f41eef /src/buffer.h | |
| parent | 6a097a86210cf1226d432b255cc41aa74fe93507 (diff) | |
| download | emacs-1ff69cc744eaa704afc1ff81242d41a6c09439fe.tar.gz emacs-1ff69cc744eaa704afc1ff81242d41a6c09439fe.zip | |
Improve the heuristic for long lines detection.
* src/buffer.h (struct buffer_text): New 'unchanged_size' field.
(BUF_UNCHANGED_SIZE): New macro to access the field.
* src/buffer.c (Fget_buffer_create): Initialize the field.
(Fbuffer_swap_text): Handle it.
* src/xdisp.c (mark_window_display_accurate_1): Set the field.
(redisplay_window): Use the field for long lines detection.
Diffstat (limited to 'src/buffer.h')
| -rw-r--r-- | src/buffer.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/buffer.h b/src/buffer.h index 09daa29992a..c2dca0a10c1 100644 --- a/src/buffer.h +++ b/src/buffer.h | |||
| @@ -144,6 +144,9 @@ enum { BEG = 1, BEG_BYTE = BEG }; | |||
| 144 | #define BUF_UNCHANGED_MODIFIED(buf) \ | 144 | #define BUF_UNCHANGED_MODIFIED(buf) \ |
| 145 | ((buf)->text->unchanged_modified) | 145 | ((buf)->text->unchanged_modified) |
| 146 | 146 | ||
| 147 | #define BUF_UNCHANGED_SIZE(buf) \ | ||
| 148 | ((buf)->text->unchanged_size) | ||
| 149 | |||
| 147 | #define BUF_OVERLAY_UNCHANGED_MODIFIED(buf) \ | 150 | #define BUF_OVERLAY_UNCHANGED_MODIFIED(buf) \ |
| 148 | ((buf)->text->overlay_unchanged_modified) | 151 | ((buf)->text->overlay_unchanged_modified) |
| 149 | #define BUF_BEG_UNCHANGED(buf) ((buf)->text->beg_unchanged) | 152 | #define BUF_BEG_UNCHANGED(buf) ((buf)->text->beg_unchanged) |
| @@ -267,6 +270,9 @@ struct buffer_text | |||
| 267 | end_unchanged contain no useful information. */ | 270 | end_unchanged contain no useful information. */ |
| 268 | modiff_count overlay_unchanged_modified; | 271 | modiff_count overlay_unchanged_modified; |
| 269 | 272 | ||
| 273 | /* Buffer size as of last redisplay that finished. */ | ||
| 274 | ptrdiff_t unchanged_size; | ||
| 275 | |||
| 270 | /* Properties of this buffer's text. */ | 276 | /* Properties of this buffer's text. */ |
| 271 | INTERVAL intervals; | 277 | INTERVAL intervals; |
| 272 | 278 | ||