diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/xdisp.c | 21 |
2 files changed, 17 insertions, 9 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 8ed6761e1dd..5861ee6c48b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2011-08-05 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that | ||
| 4 | came from a string character with a `cursor' property. (Bug#9229) | ||
| 5 | |||
| 1 | 2011-08-04 Jan Djärv <jan.h.d@swipnet.se> | 6 | 2011-08-04 Jan Djärv <jan.h.d@swipnet.se> |
| 2 | 7 | ||
| 3 | * Makefile.in (LIB_PTHREAD): New variable. | 8 | * Makefile.in (LIB_PTHREAD): New variable. |
diff --git a/src/xdisp.c b/src/xdisp.c index d1598e5ed40..59a6bc3f906 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -13706,14 +13706,12 @@ set_cursor_from_row (struct window *w, struct glyph_row *row, | |||
| 13706 | w->cursor.vpos >= 0 | 13706 | w->cursor.vpos >= 0 |
| 13707 | /* that candidate is not the row we are processing */ | 13707 | /* that candidate is not the row we are processing */ |
| 13708 | && MATRIX_ROW (matrix, w->cursor.vpos) != row | 13708 | && MATRIX_ROW (matrix, w->cursor.vpos) != row |
| 13709 | /* the row we are processing is part of a continued line */ | ||
| 13710 | && (row->continued_p || MATRIX_ROW_CONTINUATION_LINE_P (row)) | ||
| 13711 | /* Make sure cursor.vpos specifies a row whose start and end | 13709 | /* Make sure cursor.vpos specifies a row whose start and end |
| 13712 | charpos occlude point. This is because some callers of this | 13710 | charpos occlude point. This is because some callers of this |
| 13713 | function leave cursor.vpos at the row where the cursor was | 13711 | function leave cursor.vpos at the row where the cursor was |
| 13714 | displayed during the last redisplay cycle. */ | 13712 | displayed during the last redisplay cycle. */ |
| 13715 | && MATRIX_ROW_START_CHARPOS (MATRIX_ROW (matrix, w->cursor.vpos)) <= pt_old | 13713 | && MATRIX_ROW_START_CHARPOS (MATRIX_ROW (matrix, w->cursor.vpos)) <= pt_old |
| 13716 | && pt_old < MATRIX_ROW_END_CHARPOS (MATRIX_ROW (matrix, w->cursor.vpos))) | 13714 | && pt_old <= MATRIX_ROW_END_CHARPOS (MATRIX_ROW (matrix, w->cursor.vpos))) |
| 13717 | { | 13715 | { |
| 13718 | struct glyph *g1 = | 13716 | struct glyph *g1 = |
| 13719 | MATRIX_ROW_GLYPH_START (matrix, w->cursor.vpos) + w->cursor.hpos; | 13717 | MATRIX_ROW_GLYPH_START (matrix, w->cursor.vpos) + w->cursor.hpos; |
| @@ -13722,15 +13720,20 @@ set_cursor_from_row (struct window *w, struct glyph_row *row, | |||
| 13722 | if (!(row->reversed_p ? glyph > glyphs_end : glyph < glyphs_end)) | 13720 | if (!(row->reversed_p ? glyph > glyphs_end : glyph < glyphs_end)) |
| 13723 | return 0; | 13721 | return 0; |
| 13724 | /* Keep the candidate whose buffer position is the closest to | 13722 | /* Keep the candidate whose buffer position is the closest to |
| 13725 | point. */ | 13723 | point or has the `cursor' property. */ |
| 13726 | if (/* previous candidate is a glyph in TEXT_AREA of that row */ | 13724 | if (/* previous candidate is a glyph in TEXT_AREA of that row */ |
| 13727 | w->cursor.hpos >= 0 | 13725 | w->cursor.hpos >= 0 |
| 13728 | && w->cursor.hpos < MATRIX_ROW_USED (matrix, w->cursor.vpos) | 13726 | && w->cursor.hpos < MATRIX_ROW_USED (matrix, w->cursor.vpos) |
| 13729 | && BUFFERP (g1->object) | 13727 | && ((BUFFERP (g1->object) |
| 13730 | && (g1->charpos == pt_old /* an exact match always wins */ | 13728 | && (g1->charpos == pt_old /* an exact match always wins */ |
| 13731 | || (BUFFERP (glyph->object) | 13729 | || (BUFFERP (glyph->object) |
| 13732 | && eabs (g1->charpos - pt_old) | 13730 | && eabs (g1->charpos - pt_old) |
| 13733 | < eabs (glyph->charpos - pt_old)))) | 13731 | < eabs (glyph->charpos - pt_old)))) |
| 13732 | /* previous candidate is a glyph from a string that has | ||
| 13733 | a non-nil `cursor' property */ | ||
| 13734 | || (STRINGP (g1->object) | ||
| 13735 | && !NILP (Fget_char_property (make_number (g1->charpos), | ||
| 13736 | Qcursor, g1->object))))) | ||
| 13734 | return 0; | 13737 | return 0; |
| 13735 | /* If this candidate gives an exact match, use that. */ | 13738 | /* If this candidate gives an exact match, use that. */ |
| 13736 | if (!(BUFFERP (glyph->object) && glyph->charpos == pt_old) | 13739 | if (!(BUFFERP (glyph->object) && glyph->charpos == pt_old) |