diff options
| author | Eli Zaretskii | 2010-01-01 07:01:23 -0500 |
|---|---|---|
| committer | Eli Zaretskii | 2010-01-01 07:01:23 -0500 |
| commit | 17a024a87de4008cd6cf94dd3b780efc7ace9a01 (patch) | |
| tree | d7c006725e41c93fc4a97d60e73e46accb6221b5 /src | |
| parent | 6c0cf21816887c8ea25c87bc526219752cf10a09 (diff) | |
| download | emacs-17a024a87de4008cd6cf94dd3b780efc7ace9a01.tar.gz emacs-17a024a87de4008cd6cf94dd3b780efc7ace9a01.zip | |
Retrospective commit from 2009-11-21.
Fix cursor positioning on empty lines with overlays.
xdisp.c (set_cursor_from_row): Fix cursor positioning on empty
lines when integer values of `cursor' property is used on display
strings.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog.bidi | 6 | ||||
| -rw-r--r-- | src/xdisp.c | 11 |
2 files changed, 13 insertions, 4 deletions
diff --git a/src/ChangeLog.bidi b/src/ChangeLog.bidi index 2f800e5ecd2..e3e1eddab75 100644 --- a/src/ChangeLog.bidi +++ b/src/ChangeLog.bidi | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2009-11-21 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * xdisp.c (set_cursor_from_row): Fix cursor positioning on empty | ||
| 4 | lines when integer values of `cursor' property is used on display | ||
| 5 | strings. | ||
| 6 | |||
| 1 | 2009-11-14 Eli Zaretskii <eliz@gnu.org> | 7 | 2009-11-14 Eli Zaretskii <eliz@gnu.org> |
| 2 | 8 | ||
| 3 | * xdisp.c (init_iterator, text_outside_line_unchanged_p) | 9 | * xdisp.c (init_iterator, text_outside_line_unchanged_p) |
diff --git a/src/xdisp.c b/src/xdisp.c index 180031be055..2d5314c7f83 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -12468,8 +12468,8 @@ set_cursor_from_row (w, row, matrix, delta, delta_bytes, dy, dvpos) | |||
| 12468 | /* Non-zero means we've seen at least one glyph that came from a | 12468 | /* Non-zero means we've seen at least one glyph that came from a |
| 12469 | display string. */ | 12469 | display string. */ |
| 12470 | int string_seen = 0; | 12470 | int string_seen = 0; |
| 12471 | /* Largest buffer position seen during scan of glyph row. */ | 12471 | /* Largest buffer position seen so far during scan of glyph row. */ |
| 12472 | EMACS_INT bpos_max = 0; | 12472 | EMACS_INT bpos_max = last_pos; |
| 12473 | /* Last buffer position covered by an overlay string with an integer | 12473 | /* Last buffer position covered by an overlay string with an integer |
| 12474 | `cursor' property. */ | 12474 | `cursor' property. */ |
| 12475 | EMACS_INT bpos_covered = 0; | 12475 | EMACS_INT bpos_covered = 0; |
| @@ -12596,7 +12596,10 @@ set_cursor_from_row (w, row, matrix, delta, delta_bytes, dy, dvpos) | |||
| 12596 | /* If the `cursor' property covers buffer positions up | 12596 | /* If the `cursor' property covers buffer positions up |
| 12597 | to and including point, we should display cursor on | 12597 | to and including point, we should display cursor on |
| 12598 | this glyph. */ | 12598 | this glyph. */ |
| 12599 | if (bpos_covered >= pt_old) | 12599 | /* Implementation note: bpos_max == pt_old when, e.g., |
| 12600 | we are in an empty line, where bpos_max is set to | ||
| 12601 | MATRIX_ROW_START_CHARPOS, see above. */ | ||
| 12602 | if (bpos_max <= pt_old && bpos_covered >= pt_old) | ||
| 12600 | { | 12603 | { |
| 12601 | cursor = glyph; | 12604 | cursor = glyph; |
| 12602 | break; | 12605 | break; |
| @@ -12651,7 +12654,7 @@ set_cursor_from_row (w, row, matrix, delta, delta_bytes, dy, dvpos) | |||
| 12651 | /* If the `cursor' property covers buffer positions up | 12654 | /* If the `cursor' property covers buffer positions up |
| 12652 | to and including point, we should display cursor on | 12655 | to and including point, we should display cursor on |
| 12653 | this glyph. */ | 12656 | this glyph. */ |
| 12654 | if (bpos_covered >= pt_old) | 12657 | if (bpos_max <= pt_old && bpos_covered >= pt_old) |
| 12655 | { | 12658 | { |
| 12656 | cursor = glyph; | 12659 | cursor = glyph; |
| 12657 | break; | 12660 | break; |