[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/emacs-24 r107846: Fix bug #11261 with curso
From: |
Eli Zaretskii |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/emacs-24 r107846: Fix bug #11261 with cursor movement in a continued line when header line is present. |
Date: |
Tue, 17 Apr 2012 18:25:17 +0300 |
User-agent: |
Bazaar (2.3.1) |
------------------------------------------------------------
revno: 107846
fixes bug(s): http://debbugs.gnu.org/11261
committer: Eli Zaretskii <address@hidden>
branch nick: emacs-24
timestamp: Tue 2012-04-17 18:25:17 +0300
message:
Fix bug #11261 with cursor movement in a continued line when header line is
present.
src/xdisp.c (string_buffer_position_lim): Limit starting position to BEGV.
(set_cursor_from_row): If called for a mode-line or header-line
row, return zero immediately.
(try_cursor_movement): If inside continuation line, don't back up
farther than the first row after the header line, if any. Don't
consider the header-line row as "partially visible", even if
MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero.
modified:
src/ChangeLog
src/xdisp.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog 2012-04-13 18:08:18 +0000
+++ b/src/ChangeLog 2012-04-17 15:25:17 +0000
@@ -1,3 +1,14 @@
+2012-04-17 Eli Zaretskii <address@hidden>
+
+ * xdisp.c (string_buffer_position_lim): Limit starting position to
+ BEGV.
+ (set_cursor_from_row): If called for a mode-line or header-line
+ row, return zero immediately.
+ (try_cursor_movement): If inside continuation line, don't back up
+ farther than the first row after the header line, if any. Don't
+ consider the header-line row as "partially visible", even if
+ MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
+
2012-04-13 Atsuo Ohki <address@hidden> (tiny change)
* lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
(bug#11238).
=== modified file 'src/xdisp.c'
--- a/src/xdisp.c 2012-04-09 12:46:34 +0000
+++ b/src/xdisp.c 2012-04-17 15:25:17 +0000
@@ -4979,7 +4979,7 @@
Lisp_Object limit, prop, pos;
int found = 0;
- pos = make_number (from);
+ pos = make_number (max (from, BEGV));
if (!back_p) /* looking forward */
{
@@ -13690,6 +13690,13 @@
comes from a text property, not from an overlay. */
int string_from_text_prop = 0;
+ /* Don't even try doing anything if called for a mode-line or
+ header-line row, since the rest of the code isn't prepared to
+ deal with such calamities. */
+ xassert (!row->mode_line_p);
+ if (row->mode_line_p)
+ return 0;
+
/* Skip over glyphs not having an object at the start and the end of
the row. These are special glyphs like truncation marks on
terminal frames. */
@@ -14906,6 +14913,8 @@
else if (rc != CURSOR_MOVEMENT_SUCCESS
&& !NILP (BVAR (XBUFFER (w->buffer),
bidi_display_reordering)))
{
+ struct glyph_row *row1;
+
/* If rows are bidi-reordered and point moved, back up
until we find a row that does not belong to a
continuation line. This is because we must consider
@@ -14916,24 +14925,28 @@
/* FIXME: Revisit this when glyph ``spilling'' in
continuation lines' rows is implemented for
bidi-reordered rows. */
- while (MATRIX_ROW_CONTINUATION_LINE_P (row))
+ for (row1 = MATRIX_FIRST_TEXT_ROW (w->current_matrix);
+ MATRIX_ROW_CONTINUATION_LINE_P (row);
+ --row)
{
/* If we hit the beginning of the displayed portion
without finding the first row of a continued
line, give up. */
- if (row <= w->current_matrix->rows)
+ if (row <= row1)
{
rc = CURSOR_MOVEMENT_MUST_SCROLL;
break;
}
xassert (row->enabled_p);
- --row;
}
}
if (must_scroll)
;
else if (rc != CURSOR_MOVEMENT_SUCCESS
&& MATRIX_ROW_PARTIALLY_VISIBLE_P (w, row)
+ /* Make sure this isn't a header line by any chance, since
+ then MATRIX_ROW_PARTIALLY_VISIBLE_P might yield non-zero. */
+ && !row->mode_line_p
&& make_cursor_line_fully_visible_p)
{
if (PT == MATRIX_ROW_END_CHARPOS (row)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/emacs-24 r107846: Fix bug #11261 with cursor movement in a continued line when header line is present.,
Eli Zaretskii <=