[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/src/xdisp.c
From: |
Kim F. Storm |
Subject: |
[Emacs-diffs] Changes to emacs/src/xdisp.c |
Date: |
Sun, 28 May 2006 20:19:07 +0000 |
Index: emacs/src/xdisp.c
diff -u emacs/src/xdisp.c:1.1100 emacs/src/xdisp.c:1.1101
--- emacs/src/xdisp.c:1.1100 Sat May 27 22:36:58 2006
+++ emacs/src/xdisp.c Sun May 28 20:19:07 2006
@@ -11620,9 +11620,11 @@
/* Set cursor position of W. PT is assumed to be displayed in ROW.
DELTA is the number of bytes by which positions recorded in ROW
- differ from current buffer positions. */
+ differ from current buffer positions.
-void
+ Return 0 if cursor is not on this row. 1 otherwise. */
+
+int
set_cursor_from_row (w, row, matrix, delta, delta_bytes, dy, dvpos)
struct window *w;
struct glyph_row *row;
@@ -11772,6 +11774,11 @@
SKIP_GLYPHS (glyph, end, x, EQ (glyph->object, string));
}
}
+
+ /* If we reached the end of the line, and end was from a string,
+ cursor is not on this line. */
+ if (glyph == end)
+ return 0;
}
w->cursor.hpos = glyph - row->glyphs[TEXT_AREA];
@@ -11805,6 +11812,8 @@
else
CHARPOS (this_line_start_pos) = 0;
}
+
+ return 1;
}
@@ -12488,8 +12497,18 @@
rc = CURSOR_MOVEMENT_MUST_SCROLL;
else
{
- set_cursor_from_row (w, row, w->current_matrix, 0, 0, 0, 0);
- rc = CURSOR_MOVEMENT_SUCCESS;
+ do
+ {
+ if (set_cursor_from_row (w, row, w->current_matrix, 0, 0, 0,
0))
+ {
+ rc = CURSOR_MOVEMENT_SUCCESS;
+ break;
+ }
+ ++row;
+ }
+ while (MATRIX_ROW_BOTTOM_Y (row) < last_y
+ && MATRIX_ROW_START_CHARPOS (row) == PT
+ && cursor_row_p (w, row));
}
}
}