diff options
| author | Eli Zaretskii | 2010-04-02 12:35:01 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2010-04-02 12:35:01 +0300 |
| commit | 9cb52861f287cbad4608a5fceddae5bac1a90ba6 (patch) | |
| tree | 76b1487015990088901b4959c4b00e8b3b7d875f | |
| parent | 52f4d8d5bbb3995601a77ee76a214e159132483b (diff) | |
| download | emacs-9cb52861f287cbad4608a5fceddae5bac1a90ba6.tar.gz emacs-9cb52861f287cbad4608a5fceddae5bac1a90ba6.zip | |
xdisp.c (set_cursor_from_row): Improve comments.
| -rw-r--r-- | src/xdisp.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index c6ae6ad4c14..997c76934d4 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -12606,7 +12606,8 @@ set_cursor_from_row (w, row, matrix, delta, delta_bytes, dy, dvpos) | |||
| 12606 | } | 12606 | } |
| 12607 | if (INTEGERP (glyph->object) && glyph->charpos < 0) | 12607 | if (INTEGERP (glyph->object) && glyph->charpos < 0) |
| 12608 | --glyph; | 12608 | --glyph; |
| 12609 | /* By default, put the cursor on the rightmost glyph. */ | 12609 | /* By default, in reversed rows we put the cursor on the |
| 12610 | rightmost (first in the reading order) glyph. */ | ||
| 12610 | for (g = end + 1; g < glyph; g++) | 12611 | for (g = end + 1; g < glyph; g++) |
| 12611 | x += g->pixel_width; | 12612 | x += g->pixel_width; |
| 12612 | cursor_x = x; | 12613 | cursor_x = x; |
| @@ -12683,7 +12684,16 @@ set_cursor_from_row (w, row, matrix, delta, delta_bytes, dy, dvpos) | |||
| 12683 | bpos_covered = bpos_max + XINT (chprop); | 12684 | bpos_covered = bpos_max + XINT (chprop); |
| 12684 | /* If the `cursor' property covers buffer positions up | 12685 | /* If the `cursor' property covers buffer positions up |
| 12685 | to and including point, we should display cursor on | 12686 | to and including point, we should display cursor on |
| 12686 | this glyph. */ | 12687 | this glyph. Note that overlays and text properties |
| 12688 | with string values stop bidi reordering, so every | ||
| 12689 | buffer position to the left of the string is always | ||
| 12690 | smaller than any position to the right of the | ||
| 12691 | string. Therefore, if a `cursor' property on one | ||
| 12692 | of the string's characters has an integer value, we | ||
| 12693 | will break out of the loop below _before_ we get to | ||
| 12694 | the position match above. IOW, integer values of | ||
| 12695 | the `cursor' property override the "exact match for | ||
| 12696 | point" strategy of positioning the cursor. */ | ||
| 12687 | /* Implementation note: bpos_max == pt_old when, e.g., | 12697 | /* Implementation note: bpos_max == pt_old when, e.g., |
| 12688 | we are in an empty line, where bpos_max is set to | 12698 | we are in an empty line, where bpos_max is set to |
| 12689 | MATRIX_ROW_START_CHARPOS, see above. */ | 12699 | MATRIX_ROW_START_CHARPOS, see above. */ |