Commit c80016b3 authored by Dmitry Antipov's avatar Dmitry Antipov

* window.h (struct window): Replace last_cursor with last_cursor_vpos

because this is the only last cursor data we need to keep and consult.
* window.c (replace_window, set_window_buffer, Fsplit_window_internal):
* xdisp.c (mark_window_display_accurate_1, try_cursor_movement):
Adjust users.
parent df54bcbd
2013-08-26 Dmitry Antipov <dmantipov@yandex.ru>
* window.h (struct window): Replace last_cursor with last_cursor_vpos
because this is the only last cursor data we need to keep and consult.
* window.c (replace_window, set_window_buffer, Fsplit_window_internal):
* xdisp.c (mark_window_display_accurate_1, try_cursor_movement):
Adjust users.
2013-08-26 Dmitry Antipov <dmantipov@yandex.ru>
Fix recovering from possible decompression error. Since
......
......@@ -2027,8 +2027,8 @@ replace_window (Lisp_Object old, Lisp_Object new, int setflag)
n->desired_matrix = n->current_matrix = 0;
n->vscroll = 0;
memset (&n->cursor, 0, sizeof (n->cursor));
memset (&n->last_cursor, 0, sizeof (n->last_cursor));
memset (&n->phys_cursor, 0, sizeof (n->phys_cursor));
n->last_cursor_vpos = 0;
n->phys_cursor_type = -1;
n->phys_cursor_width = -1;
n->must_be_updated_p = 0;
......@@ -3172,7 +3172,7 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer,
w->window_end_pos = 0;
w->window_end_vpos = 0;
memset (&w->last_cursor, 0, sizeof w->last_cursor);
w->last_cursor_vpos = 0;
if (!(keep_margins_p && samebuf))
{ /* If we're not actually changing the buffer, don't reset hscroll and
......@@ -3911,7 +3911,7 @@ set correctly. See the code of `split-window' for how this is done. */)
}
n->window_end_valid = 0;
memset (&n->last_cursor, 0, sizeof n->last_cursor);
n->last_cursor_vpos = 0;
/* Get special geometry settings from reference window. */
n->left_margin_cols = r->left_margin_cols;
......
......@@ -229,10 +229,6 @@ struct window
as the normal may yield a matrix which is too small. */
int nrows_scale_factor, ncols_scale_factor;
/* Cursor position as of last update that completed without
pause. This is the position of last_point. */
struct cursor_pos last_cursor;
/* Intended cursor position. This is a position within the
glyph matrix. */
struct cursor_pos cursor;
......@@ -240,6 +236,10 @@ struct window
/* Where the cursor actually is. */
struct cursor_pos phys_cursor;
/* Vertical cursor position as of last update that completed
without pause. This is the position of last_point. */
int last_cursor_vpos;
/* Cursor type and width of last cursor drawn on the window.
Used for X and w32 frames; -1 initially. */
int phys_cursor_type, phys_cursor_width;
......
......@@ -13743,7 +13743,7 @@ mark_window_display_accurate_1 (struct window *w, int accurate_p)
w->current_matrix->begv = BUF_BEGV (b);
w->current_matrix->zv = BUF_ZV (b);
w->last_cursor = w->cursor;
w->last_cursor_vpos = w->cursor.vpos;
w->last_cursor_off_p = w->cursor_off_p;
if (w == XWINDOW (selected_window))
......@@ -15087,12 +15087,12 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_ste
/* Start with the row the cursor was displayed during the last
not paused redisplay. Give up if that row is not valid. */
if (w->last_cursor.vpos < 0
|| w->last_cursor.vpos >= w->current_matrix->nrows)
if (w->last_cursor_vpos < 0
|| w->last_cursor_vpos >= w->current_matrix->nrows)
rc = CURSOR_MOVEMENT_MUST_SCROLL;
else
{
row = MATRIX_ROW (w->current_matrix, w->last_cursor.vpos);
row = MATRIX_ROW (w->current_matrix, w->last_cursor_vpos);
if (row->mode_line_p)
++row;
if (!row->enabled_p)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment