comparison src/move.c @ 14720:a9665096074b v8.1.0372

patch 8.1.0372: screen updating slow when 'cursorline' is set commit https://github.com/vim/vim/commit/90a997987dbbe43af3c15118a35f658f0f037d1d Author: Bram Moolenaar <Bram@vim.org> Date: Wed Sep 12 21:52:18 2018 +0200 patch 8.1.0372: screen updating slow when 'cursorline' is set Problem: Screen updating slow when 'cursorline' is set. Solution: Only redraw the old and new cursor line, not all lines.
author Christian Brabandt <cb@256bit.org>
date Wed, 12 Sep 2018 22:00:07 +0200
parents 1bc96dbb5498
children 9b150311eb9c
comparison
equal deleted inserted replaced
14719:d5bfff0b5ebe 14720:a9665096074b
121 wp->w_valid |= VALID_BOTLINE|VALID_BOTLINE_AP; 121 wp->w_valid |= VALID_BOTLINE|VALID_BOTLINE_AP;
122 122
123 set_empty_rows(wp, done); 123 set_empty_rows(wp, done);
124 } 124 }
125 125
126 #ifdef FEAT_SYN_HL
127 static linenr_T last_cursorline = 0;
128 #endif
129
126 /* 130 /*
127 * Redraw when w_cline_row changes and 'relativenumber' or 'cursorline' is 131 * Redraw when w_cline_row changes and 'relativenumber' or 'cursorline' is
128 * set. 132 * set.
129 */ 133 */
130 static void 134 static void
138 && (wp->w_valid & VALID_CROW) == 0 142 && (wp->w_valid & VALID_CROW) == 0
139 # ifdef FEAT_INS_EXPAND 143 # ifdef FEAT_INS_EXPAND
140 && !pum_visible() 144 && !pum_visible()
141 # endif 145 # endif
142 ) 146 )
143 redraw_win_later(wp, SOME_VALID); 147 {
148 #ifdef FEAT_SYN_HL
149 if (!wp->w_p_rnu && wp->w_redr_type <= VALID && last_cursorline != 0)
150 {
151 // "last_cursorline" may be set for another window, worst case we
152 // redraw too much. This is optimized for moving the cursor around
153 // in the same window.
154 redrawWinline(wp, last_cursorline, FALSE);
155 redrawWinline(wp, wp->w_cursor.lnum, FALSE);
156 last_cursorline = wp->w_cursor.lnum;
157 redraw_win_later(wp, VALID);
158 }
159 else
160 #endif
161 redraw_win_later(wp, SOME_VALID);
162 }
144 } 163 }
145 164
146 /* 165 /*
147 * Update curwin->w_topline and redraw if necessary. 166 * Update curwin->w_topline and redraw if necessary.
148 * Used to update the screen before printing a message. 167 * Used to update the screen before printing a message.