diff options
| author | Eli Zaretskii | 2021-04-22 13:59:08 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2021-04-22 13:59:08 +0300 |
| commit | 7792f7b3f3cdc40cf8636096fd5966eecebad1b5 (patch) | |
| tree | 2ae225459cbeb3fd46d7a84a51c1707e7a59b504 /src | |
| parent | 71b14f28068d9327eb236b8577ccbddd65e3b38b (diff) | |
| download | emacs-7792f7b3f3cdc40cf8636096fd5966eecebad1b5.tar.gz emacs-7792f7b3f3cdc40cf8636096fd5966eecebad1b5.zip | |
Fix 'window-text-pixel-size' when there's after-string at EOB
* src/xdisp.c (move_it_to): Fix logic of reaching TO_CHARPOS when
there's a display or overlay string(s) at EOB. (Bug#47860)
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 8ffec93e45d..7a89089958f 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -10064,8 +10064,20 @@ move_it_to (struct it *it, ptrdiff_t to_charpos, int to_x, int to_y, int to_vpos | |||
| 10064 | if ((op & MOVE_TO_POS) != 0 | 10064 | if ((op & MOVE_TO_POS) != 0 |
| 10065 | && (IT_CHARPOS (*it) > to_charpos | 10065 | && (IT_CHARPOS (*it) > to_charpos |
| 10066 | || (IT_CHARPOS (*it) == to_charpos | 10066 | || (IT_CHARPOS (*it) == to_charpos |
| 10067 | /* Consider TO_CHARPOS as REACHED if we are at | ||
| 10068 | EOB that ends in something other than a newline. */ | ||
| 10067 | && to_charpos == ZV | 10069 | && to_charpos == ZV |
| 10068 | && (ZV_BYTE <= 1 || FETCH_BYTE (ZV_BYTE - 1) != '\n')))) | 10070 | && (ZV_BYTE <= 1 || FETCH_BYTE (ZV_BYTE - 1) != '\n') |
| 10071 | /* But if we have a display or an overlay string | ||
| 10072 | at EOB, keep going until we exhaust all the | ||
| 10073 | characters of the string(s). */ | ||
| 10074 | && (it->sp == 0 | ||
| 10075 | || (STRINGP (it->string) | ||
| 10076 | && (it->current.overlay_string_index < 0 | ||
| 10077 | || (it->current.overlay_string_index >= 0 | ||
| 10078 | && it->current.overlay_string_index | ||
| 10079 | >= it->n_overlay_strings - 1)) | ||
| 10080 | && IT_STRING_CHARPOS (*it) >= it->end_charpos))))) | ||
| 10069 | { | 10081 | { |
| 10070 | reached = 9; | 10082 | reached = 9; |
| 10071 | goto out; | 10083 | goto out; |