diff options
author | Eli Zaretskii <eliz@gnu.org> | 2012-06-16 14:47:44 +0300 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2012-06-16 14:47:44 +0300 |
commit | 946fdb736dc076e181a3e82cfd4cc307cc061114 (patch) | |
tree | b98760811ae5ececc48ec0995d3af11647ad5f08 | |
parent | 1097afe4554bd14af9817100d9a53d6be628656e (diff) | |
download | emacs-946fdb736dc076e181a3e82cfd4cc307cc061114.tar.gz |
Fix bug #11720 with cursor positioning in outline-mode and Org buffers.
src/xdisp.c (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
the rightmost.
-rw-r--r-- | src/ChangeLog | 2 | ||||
-rw-r--r-- | src/xdisp.c | 9 |
2 files changed, 5 insertions, 6 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 3f73b1ad702..61a2b3d78f3 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -6,6 +6,8 @@ row. (handle_face_prop): Use chunk-relative overlay string index when indexing into it->string_overlays array. (Bug#11653) + (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not + the rightmost. (Bug#11720) 2012-06-16 Andreas Schwab <schwab@linux-m68k.org> diff --git a/src/xdisp.c b/src/xdisp.c index aa130c5d50a..04baeea9706 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -13937,16 +13937,13 @@ set_cursor_from_row (struct window *w, struct glyph_row *row, break; } /* See if we've found a better approximation to - POS_BEFORE or to POS_AFTER. Note that we want the - first (leftmost) glyph of all those that are the - closest from below, and the last (rightmost) of all - those from above. */ + POS_BEFORE or to POS_AFTER. */ if (0 > dpos && dpos > pos_before - pt_old) { pos_before = glyph->charpos; glyph_before = glyph; } - else if (0 < dpos && dpos <= pos_after - pt_old) + else if (0 < dpos && dpos < pos_after - pt_old) { pos_after = glyph->charpos; glyph_after = glyph; @@ -14030,7 +14027,7 @@ set_cursor_from_row (struct window *w, struct glyph_row *row, pos_before = glyph->charpos; glyph_before = glyph; } - else if (0 < dpos && dpos <= pos_after - pt_old) + else if (0 < dpos && dpos < pos_after - pt_old) { pos_after = glyph->charpos; glyph_after = glyph; |