Mercurial > vim
comparison src/move.c @ 14724:90de24a1e9b7 v8.1.0374
patch 8.1.0374: moving the cursor is slow when 'relativenumber' is set
commit https://github.com/vim/vim/commit/bd9a53c06c8869ad811cb3dd01a309c9be7d7a63
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Sep 12 23:15:48 2018 +0200
patch 8.1.0374: moving the cursor is slow when 'relativenumber' is set
Problem: Moving the cursor is slow when 'relativenumber' is set.
Solution: Only redraw the number column, not all lines.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Wed, 12 Sep 2018 23:30:06 +0200 |
parents | 9b150311eb9c |
children | 10107703b9b2 |
comparison
equal
deleted
inserted
replaced
14723:9687fadbf083 | 14724:90de24a1e9b7 |
---|---|
143 # ifdef FEAT_INS_EXPAND | 143 # ifdef FEAT_INS_EXPAND |
144 && !pum_visible() | 144 && !pum_visible() |
145 # endif | 145 # endif |
146 ) | 146 ) |
147 { | 147 { |
148 if (wp->w_p_rnu) | |
149 // win_line() will redraw the number column only. | |
150 redraw_win_later(wp, VALID); | |
148 #ifdef FEAT_SYN_HL | 151 #ifdef FEAT_SYN_HL |
149 if (!wp->w_p_rnu && wp->w_redr_type <= VALID && last_cursorline != 0) | 152 if (wp->w_p_cul) |
150 { | 153 { |
151 // "last_cursorline" may be set for another window, worst case we | 154 if (wp->w_redr_type <= VALID && last_cursorline != 0) |
152 // redraw too much. This is optimized for moving the cursor around | 155 { |
153 // in the same window. | 156 // "last_cursorline" may be set for another window, worst case |
154 redrawWinline(wp, last_cursorline, FALSE); | 157 // we redraw too much. This is optimized for moving the cursor |
155 redrawWinline(wp, wp->w_cursor.lnum, FALSE); | 158 // around in the same window. |
156 redraw_win_later(wp, VALID); | 159 redrawWinline(wp, last_cursorline, FALSE); |
157 } | 160 redrawWinline(wp, wp->w_cursor.lnum, FALSE); |
158 else | 161 redraw_win_later(wp, VALID); |
159 #endif | 162 } |
160 redraw_win_later(wp, SOME_VALID); | 163 else |
161 #ifdef FEAT_SYN_HL | 164 redraw_win_later(wp, SOME_VALID); |
162 last_cursorline = wp->w_cursor.lnum; | 165 last_cursorline = wp->w_cursor.lnum; |
166 } | |
163 #endif | 167 #endif |
164 } | 168 } |
165 } | 169 } |
166 | 170 |
167 /* | 171 /* |