summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.0372
blob: d5262bb778d48a9213fd5889d7682a666395919c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0372
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 8.1.0372
Problem:    Screen updating slow when 'cursorline' is set.
Solution:   Only redraw the old and new cursor line, not all lines.
Files:	    src/edit.c, src/move.c, src/screen.c, src/proto/screen.pro


*** ../vim-8.1.0371/src/edit.c	2018-08-08 22:08:28.326846653 +0200
--- src/edit.c	2018-09-12 21:39:50.838327555 +0200
***************
*** 1966,1972 ****
  	if (pc_status == PC_STATUS_RIGHT)
  	    ++curwin->w_wcol;
  	if (pc_status == PC_STATUS_RIGHT || pc_status == PC_STATUS_LEFT)
! 	    redrawWinline(curwin->w_cursor.lnum, FALSE);
  	else
  #endif
  	    screen_puts(pc_bytes, pc_row - msg_scrolled, pc_col, pc_attr);
--- 1966,1972 ----
  	if (pc_status == PC_STATUS_RIGHT)
  	    ++curwin->w_wcol;
  	if (pc_status == PC_STATUS_RIGHT || pc_status == PC_STATUS_LEFT)
! 	    redrawWinline(curwin, curwin->w_cursor.lnum, FALSE);
  	else
  #endif
  	    screen_puts(pc_bytes, pc_row - msg_scrolled, pc_col, pc_attr);
***************
*** 2017,2023 ****
      if (dollar_vcol >= 0)
      {
  	dollar_vcol = -1;
! 	redrawWinline(curwin->w_cursor.lnum, FALSE);
      }
  }
  
--- 2017,2023 ----
      if (dollar_vcol >= 0)
      {
  	dollar_vcol = -1;
! 	redrawWinline(curwin, curwin->w_cursor.lnum, FALSE);
      }
  }
  
***************
*** 7079,7085 ****
  	linenr_T	lnum = spell_redraw_lnum;
  
  	spell_redraw_lnum = 0;
! 	redrawWinline(lnum, FALSE);
      }
  }
  
--- 7079,7085 ----
  	linenr_T	lnum = spell_redraw_lnum;
  
  	spell_redraw_lnum = 0;
! 	redrawWinline(curwin, lnum, FALSE);
      }
  }
  
*** ../vim-8.1.0371/src/move.c	2018-07-10 15:07:11.779668824 +0200
--- src/move.c	2018-09-12 21:43:54.096174935 +0200
***************
*** 123,128 ****
--- 123,132 ----
      set_empty_rows(wp, done);
  }
  
+ #ifdef FEAT_SYN_HL
+ static linenr_T	last_cursorline = 0;
+ #endif
+ 
  /*
   * Redraw when w_cline_row changes and 'relativenumber' or 'cursorline' is
   * set.
***************
*** 140,146 ****
  	    && !pum_visible()
  # endif
  	    )
! 	redraw_win_later(wp, SOME_VALID);
  }
  
  /*
--- 144,165 ----
  	    && !pum_visible()
  # endif
  	    )
!     {
! #ifdef FEAT_SYN_HL
! 	if (!wp->w_p_rnu && wp->w_redr_type <= VALID && last_cursorline != 0)
! 	{
! 	    // "last_cursorline" may be set for another window, worst case we
! 	    // redraw too much.  This is optimized for moving the cursor around
! 	    // in the same window.
! 	    redrawWinline(wp, last_cursorline, FALSE);
! 	    redrawWinline(wp, wp->w_cursor.lnum, FALSE);
! 	    last_cursorline = wp->w_cursor.lnum;
! 	    redraw_win_later(wp, VALID);
! 	}
! 	else
! #endif
! 	    redraw_win_later(wp, SOME_VALID);
!     }
  }
  
  /*
*** ../vim-8.1.0371/src/screen.c	2018-09-06 13:14:39.144722527 +0200
--- src/screen.c	2018-09-12 21:41:32.553424559 +0200
***************
*** 496,501 ****
--- 496,502 ----
   */
      void
  redrawWinline(
+     win_T	*wp,
      linenr_T	lnum,
      int		invalid UNUSED)	/* window line height is invalid now */
  {
***************
*** 503,521 ****
      int		i;
  #endif
  
!     if (curwin->w_redraw_top == 0 || curwin->w_redraw_top > lnum)
! 	curwin->w_redraw_top = lnum;
!     if (curwin->w_redraw_bot == 0 || curwin->w_redraw_bot < lnum)
! 	curwin->w_redraw_bot = lnum;
!     redraw_later(VALID);
  
  #ifdef FEAT_FOLDING
      if (invalid)
      {
  	/* A w_lines[] entry for this lnum has become invalid. */
! 	i = find_wl_entry(curwin, lnum);
  	if (i >= 0)
! 	    curwin->w_lines[i].wl_valid = FALSE;
      }
  #endif
  }
--- 504,522 ----
      int		i;
  #endif
  
!     if (wp->w_redraw_top == 0 || wp->w_redraw_top > lnum)
! 	wp->w_redraw_top = lnum;
!     if (wp->w_redraw_bot == 0 || wp->w_redraw_bot < lnum)
! 	wp->w_redraw_bot = lnum;
!     redraw_win_later(wp, VALID);
  
  #ifdef FEAT_FOLDING
      if (invalid)
      {
  	/* A w_lines[] entry for this lnum has become invalid. */
! 	i = find_wl_entry(wp, lnum);
  	if (i >= 0)
! 	    wp->w_lines[i].wl_valid = FALSE;
      }
  #endif
  }
*** ../vim-8.1.0371/src/proto/screen.pro	2018-06-16 15:32:34.460024472 +0200
--- src/proto/screen.pro	2018-09-12 21:41:33.929412376 +0200
***************
*** 8,14 ****
  void redraw_buf_and_status_later(buf_T *buf, int type);
  int redraw_asap(int type);
  void redraw_after_callback(int call_update_screen);
! void redrawWinline(linenr_T lnum, int invalid);
  void reset_updating_screen(int may_resize_shell);
  void update_curbuf(int type);
  int update_screen(int type_arg);
--- 8,14 ----
  void redraw_buf_and_status_later(buf_T *buf, int type);
  int redraw_asap(int type);
  void redraw_after_callback(int call_update_screen);
! void redrawWinline(win_T *wp, linenr_T lnum, int invalid);
  void reset_updating_screen(int may_resize_shell);
  void update_curbuf(int type);
  int update_screen(int type_arg);
*** ../vim-8.1.0371/src/version.c	2018-09-12 20:29:05.479670601 +0200
--- src/version.c	2018-09-12 21:51:28.616197716 +0200
***************
*** 796,797 ****
--- 796,799 ----
  {   /* Add new patch number below this line */
+ /**/
+     372,
  /**/

-- 
Despite the cost of living, have you noticed how it remains so popular?

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///