summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2014-06-11 19:11:32 +0300
committerEli Zaretskii <eliz@gnu.org>2014-06-11 19:11:32 +0300
commitdf907af0ddfc4282a6184f1b516cd92dbdf0093f (patch)
tree2634706a9f5fb4d188336d2394da02f17483f76b /src
parent4abee665f60b1eb705d47ba82e3aa4b910f5a040 (diff)
downloademacs-df907af0ddfc4282a6184f1b516cd92dbdf0093f.tar.gz
Fix bug #17744 with cursor motion near overlay string with 'cursor' prop.
src/xdisp.c (set_cursor_from_row): Fix an off-by-one error when matching overlay strings with 'cursor' property against buffer positions traversed in the glyph row.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog6
-rw-r--r--src/xdisp.c6
2 files changed, 9 insertions, 3 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index f7ee48d1d07..3468cea6159 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
+2014-06-11 Eli Zaretskii <eliz@gnu.org>
+
+ * xdisp.c (set_cursor_from_row): Fix an off-by-one error when
+ matching overlay strings with 'cursor' property against buffer
+ positions traversed in the glyph row. (Bug#17744)
+
2014-06-08 Glenn Morris <rgm@gnu.org>
* fileio.c (write-region-inhibit-fsync): Doc tweak.
diff --git a/src/xdisp.c b/src/xdisp.c
index 1a5c29ac5be..f0eeb9ac601 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -14421,7 +14421,7 @@ set_cursor_from_row (struct window *w, struct glyph_row *row,
pos_after, 0);
if (prop_pos >= pos_before)
- bpos_max = prop_pos - 1;
+ bpos_max = prop_pos;
}
if (INTEGERP (chprop))
{
@@ -14495,7 +14495,7 @@ set_cursor_from_row (struct window *w, struct glyph_row *row,
pos_after, 0);
if (prop_pos >= pos_before)
- bpos_max = prop_pos - 1;
+ bpos_max = prop_pos;
}
if (INTEGERP (chprop))
{
@@ -14525,7 +14525,7 @@ set_cursor_from_row (struct window *w, struct glyph_row *row,
GLYPH_BEFORE and GLYPH_AFTER. */
if (!((row->reversed_p ? glyph > glyphs_end : glyph < glyphs_end)
&& BUFFERP (glyph->object) && glyph->charpos == pt_old)
- && !(bpos_max < pt_old && pt_old <= bpos_covered))
+ && !(bpos_max <= pt_old && pt_old <= bpos_covered))
{
/* An empty line has a single glyph whose OBJECT is zero and
whose CHARPOS is the position of a newline on that line.