diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 16ac7dba318..ac16e694b57 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -3392,7 +3392,14 @@ back_to_previous_line_start (it) | |||
| 3392 | 3392 | ||
| 3393 | Newlines may come from buffer text, overlay strings, or strings | 3393 | Newlines may come from buffer text, overlay strings, or strings |
| 3394 | displayed via the `display' property. That's the reason we can't | 3394 | displayed via the `display' property. That's the reason we can't |
| 3395 | simply use find_next_newline_no_quit. */ | 3395 | simply use find_next_newline_no_quit. |
| 3396 | |||
| 3397 | Note that this function may not skip over invisible text that is so | ||
| 3398 | because of text properties and immediately follows a newline. If | ||
| 3399 | it would, function reseat_at_next_visible_line_start, when called | ||
| 3400 | from set_iterator_to_next, would effectively make invisible | ||
| 3401 | characters following a newline part of the wrong glyph row, which | ||
| 3402 | leads to wrong cursor motion. */ | ||
| 3396 | 3403 | ||
| 3397 | static int | 3404 | static int |
| 3398 | forward_to_next_line_start (it, skipped_p) | 3405 | forward_to_next_line_start (it, skipped_p) |
| @@ -3402,9 +3409,18 @@ forward_to_next_line_start (it, skipped_p) | |||
| 3402 | int old_selective, newline_found_p, n; | 3409 | int old_selective, newline_found_p, n; |
| 3403 | const int MAX_NEWLINE_DISTANCE = 500; | 3410 | const int MAX_NEWLINE_DISTANCE = 500; |
| 3404 | 3411 | ||
| 3412 | /* If already on a newline, just consume it to avoid unintended | ||
| 3413 | skipping over invisible text below. */ | ||
| 3414 | if (ITERATOR_AT_END_OF_LINE_P (it)) | ||
| 3415 | { | ||
| 3416 | set_iterator_to_next (it, 0); | ||
| 3417 | return 1; | ||
| 3418 | } | ||
| 3419 | |||
| 3405 | /* Don't handle selective display in the following. It's (a) | 3420 | /* Don't handle selective display in the following. It's (a) |
| 3406 | unnecessary and (b) leads to an infinite recursion because | 3421 | unnecessary because it's done by the caller, and (b) leads to an |
| 3407 | next_element_from_ellipsis indirectly calls this function. */ | 3422 | infinite recursion because next_element_from_ellipsis indirectly |
| 3423 | calls this function. */ | ||
| 3408 | old_selective = it->selective; | 3424 | old_selective = it->selective; |
| 3409 | it->selective = 0; | 3425 | it->selective = 0; |
| 3410 | 3426 | ||
| @@ -11851,7 +11867,7 @@ highlight_trailing_whitespace (f, row) | |||
| 11851 | 11867 | ||
| 11852 | 11868 | ||
| 11853 | /* Value is non-zero if glyph row ROW in window W should be | 11869 | /* Value is non-zero if glyph row ROW in window W should be |
| 11854 | used to put the cursor on. */ | 11870 | used to hold the cursor. */ |
| 11855 | 11871 | ||
| 11856 | static int | 11872 | static int |
| 11857 | cursor_row_p (w, row) | 11873 | cursor_row_p (w, row) |