]> code.delx.au - gnu-emacs/commitdiff
* window.h (struct window): Replace last_cursor with last_cursor_vpos
authorDmitry Antipov <dmantipov@yandex.ru>
Mon, 26 Aug 2013 09:33:37 +0000 (13:33 +0400)
committerDmitry Antipov <dmantipov@yandex.ru>
Mon, 26 Aug 2013 09:33:37 +0000 (13:33 +0400)
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.

src/ChangeLog
src/window.c
src/window.h
src/xdisp.c

index e4dcfffa02fb4afc6d00720bc4b1fc10b217f252..6408397c13e3a725efdb24d87da691eeee23f00c 100644 (file)
@@ -1,3 +1,11 @@
+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
index 023dc485d7f07e3fb3492407dace4ea0eb0269d1..6ef32608a5640a53f84120d44b3e817c78a6017e 100644 (file)
@@ -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;
index c64641825e3838edcb3cf9efacba2b9ce6340a39..de77dcabc85184444ab3e2d83df04c6562c0806b 100644 (file)
@@ -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;
index 6257add2f4eea19da96720d72d746b1d64c95ac3..cbb70a22bfb82fe53279bd6a77591214ad1cc88e 100644 (file)
@@ -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)