diff options
author | Chong Yidong <cyd@stupidchicken.com> | 2007-04-10 15:57:25 +0000 |
---|---|---|
committer | Chong Yidong <cyd@stupidchicken.com> | 2007-04-10 15:57:25 +0000 |
commit | 796f2ac9859c3487d4285dde0798428c101e1bd9 (patch) | |
tree | 626f5e0140232705d7b9aa40e40aa55c8eb367ca /src | |
parent | 63a4fc686d68caab09b52921b5dc6cf692062564 (diff) | |
download | emacs-796f2ac9859c3487d4285dde0798428c101e1bd9.tar.gz |
(note_mode_line_or_margin_highlight): Don't decrement glyph pointer
before start of glyph row.
Diffstat (limited to 'src')
-rw-r--r-- | src/xdisp.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index fd65856c8e5..90977aa3d7d 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -22437,7 +22437,7 @@ note_mode_line_or_margin_highlight (window, x, y, area) Lisp_Object mouse_face; int original_x_pixel = x; - struct glyph * glyph = NULL; + struct glyph * glyph = NULL, * row_start_glyph = NULL; struct glyph_row *row; if (area == ON_MODE_LINE || area == ON_HEADER_LINE) @@ -22455,7 +22455,7 @@ note_mode_line_or_margin_highlight (window, x, y, area) /* Find glyph */ if (row->mode_line_p && row->enabled_p) { - glyph = row->glyphs[TEXT_AREA]; + glyph = row_start_glyph = row->glyphs[TEXT_AREA]; end = glyph + row->used[TEXT_AREA]; for (x0 = original_x_pixel; @@ -22579,12 +22579,17 @@ note_mode_line_or_margin_highlight (window, x, y, area) is converted to a flatten by emacs lisp interpreter. The internal string is an element of the structures. The displayed string is the flatten string. */ - for (tmp_glyph = glyph - 1, gpos = 0; - tmp_glyph->charpos >= XINT (b); - tmp_glyph--, gpos++) + gpos = 0; + if (glyph > row_start_glyph) { - if (!EQ (tmp_glyph->object, glyph->object)) - break; + tmp_glyph = glyph - 1; + while (tmp_glyph >= row_start_glyph + && tmp_glyph->charpos >= XINT (b) + && EQ (tmp_glyph->object, glyph->object)) + { + tmp_glyph--; + gpos++; + } } /* Calculate the lenght(glyph sequence length: GSEQ_LENGTH) of |