diff options
| author | Eli Zaretskii | 2019-03-02 12:17:47 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2019-03-02 12:17:47 +0200 |
| commit | dbffbe08815644fd30404891ef81496277ed27da (patch) | |
| tree | f6f572e9445143813327bf8f97c9b1acea967ac0 /src | |
| parent | 2028756fa3db8dc266c0abbf4ecb672ab5348e71 (diff) | |
| download | emacs-dbffbe08815644fd30404891ef81496277ed27da.tar.gz emacs-dbffbe08815644fd30404891ef81496277ed27da.zip | |
Fix 'end-of-visual-line' with overlay strings with newlines
* src/indent.c (Fvertical_motion): Get out of overlay strings
with embedded newlines even if moving within the same screen
line. See https://github.com/emacs-lsp/lsp-mode/issues/677
for more details.
Fix test for IT_CHARPOS being at the beginning of the
accessible portion of the buffer.
Diffstat (limited to 'src')
| -rw-r--r-- | src/indent.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/indent.c b/src/indent.c index bc1aa8ca2c6..1d5d346e63f 100644 --- a/src/indent.c +++ b/src/indent.c | |||
| @@ -2286,7 +2286,7 @@ whether or not it is currently displayed in some window. */) | |||
| 2286 | it.current_y = 0; | 2286 | it.current_y = 0; |
| 2287 | /* Do this even if LINES is 0, so that we move back to the | 2287 | /* Do this even if LINES is 0, so that we move back to the |
| 2288 | beginning of the current line as we ought. */ | 2288 | beginning of the current line as we ought. */ |
| 2289 | if ((nlines < 0 && IT_CHARPOS (it) > 0) | 2289 | if ((nlines < 0 && IT_CHARPOS (it) > BEGV) |
| 2290 | || (nlines == 0 && !(start_x_given && start_x <= to_x))) | 2290 | || (nlines == 0 && !(start_x_given && start_x <= to_x))) |
| 2291 | move_it_by_lines (&it, max (PTRDIFF_MIN, nlines)); | 2291 | move_it_by_lines (&it, max (PTRDIFF_MIN, nlines)); |
| 2292 | } | 2292 | } |
| @@ -2338,7 +2338,7 @@ whether or not it is currently displayed in some window. */) | |||
| 2338 | and then reposition point at the requested X coordinate; | 2338 | and then reposition point at the requested X coordinate; |
| 2339 | if we don't, the cursor will be placed just after the | 2339 | if we don't, the cursor will be placed just after the |
| 2340 | string, which might not be the requested column. */ | 2340 | string, which might not be the requested column. */ |
| 2341 | if (nlines > 0 && it.area == TEXT_AREA) | 2341 | if (nlines >= 0 && it.area == TEXT_AREA) |
| 2342 | { | 2342 | { |
| 2343 | while (it.method == GET_FROM_STRING | 2343 | while (it.method == GET_FROM_STRING |
| 2344 | && !it.string_from_display_prop_p | 2344 | && !it.string_from_display_prop_p |