comparison src/main.c @ 18440:d6cb1e706fb7 v8.1.2214

patch 8.1.2214: too much is redrawn when 'cursorline' is set Commit: https://github.com/vim/vim/commit/11a58af66fa5c442f0a22c5d59beabf187ed4e89 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Oct 24 22:32:31 2019 +0200 patch 8.1.2214: too much is redrawn when 'cursorline' is set Problem: Too much is redrawn when 'cursorline' is set. Solution: Don't do a complete redraw. (closes https://github.com/vim/vim/issues/5079)
author Bram Moolenaar <Bram@vim.org>
date Thu, 24 Oct 2019 22:45:04 +0200
parents 506bf60a30a0
children e93cab5d0f0f
comparison
equal deleted inserted replaced
18439:1768dfc3a9f6 18440:d6cb1e706fb7
1378 */ 1378 */
1379 update_topline(); 1379 update_topline();
1380 validate_cursor(); 1380 validate_cursor();
1381 1381
1382 #ifdef FEAT_SYN_HL 1382 #ifdef FEAT_SYN_HL
1383 if (curwin->w_p_cul && curwin->w_p_wrap 1383 // Might need to update for 'cursorline'.
1384 && (curwin->w_p_culopt_flags & CULOPT_SCRLINE)) 1384 // When 'cursorlineopt' is "screenline" need to redraw always.
1385 must_redraw = NOT_VALID; 1385 if (curwin->w_p_cul
1386 #endif 1386 && (curwin->w_last_cursorline != curwin->w_cursor.lnum
1387 1387 || (curwin->w_p_culopt_flags & CULOPT_SCRLINE))
1388 && !char_avail())
1389 redraw_later(VALID);
1390 #endif
1388 if (VIsual_active) 1391 if (VIsual_active)
1389 update_curbuf(INVERTED); // update inverted part 1392 update_curbuf(INVERTED); // update inverted part
1390 else if (must_redraw) 1393 else if (must_redraw)
1391 { 1394 {
1392 mch_disable_flush(); // Stop issuing gui_mch_flush(). 1395 mch_disable_flush(); // Stop issuing gui_mch_flush().
1393 #ifdef FEAT_SYN_HL 1396 update_screen(0);
1394 // Might need some more update for the cursorscreen line.
1395 // TODO: can we optimize this?
1396 if (curwin->w_p_cul
1397 && curwin->w_p_wrap
1398 && (curwin->w_p_culopt_flags & CULOPT_SCRLINE)
1399 && !char_avail())
1400 update_screen(VALID);
1401 else
1402 #endif
1403 update_screen(0);
1404 mch_enable_flush(); 1397 mch_enable_flush();
1405 } 1398 }
1406 else if (redraw_cmdline || clear_cmdline) 1399 else if (redraw_cmdline || clear_cmdline)
1407 showmode(); 1400 showmode();
1408 redraw_statuslines(); 1401 redraw_statuslines();