mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
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 #5079)
This commit is contained in:
23
src/change.c
23
src/change.c
@@ -609,16 +609,21 @@ changed_common(
|
||||
if (hasAnyFolding(wp))
|
||||
set_topline(wp, wp->w_topline);
|
||||
#endif
|
||||
// Relative numbering may require updating more. Cursor line
|
||||
// highlighting probably needs to be updated if it's below the
|
||||
// change (or is using screenline highlighting)
|
||||
if (wp->w_p_rnu
|
||||
#ifdef FEAT_SYN_HL
|
||||
|| ((wp->w_p_cul && lnum <= wp->w_last_cursorline)
|
||||
|| (wp->w_p_culopt_flags & CULOPT_SCRLINE))
|
||||
#endif
|
||||
)
|
||||
// Relative numbering may require updating more.
|
||||
if (wp->w_p_rnu)
|
||||
redraw_win_later(wp, SOME_VALID);
|
||||
#ifdef FEAT_SYN_HL
|
||||
// Cursor line highlighting probably need to be updated with
|
||||
// "VALID" if it's below the change.
|
||||
// If the cursor line is inside the change we need to redraw more.
|
||||
if (wp->w_p_cul)
|
||||
{
|
||||
if (xtra == 0)
|
||||
redraw_win_later(wp, VALID);
|
||||
else if (lnum <= wp->w_last_cursorline)
|
||||
redraw_win_later(wp, SOME_VALID);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -2124,7 +2124,12 @@ win_update(win_T *wp)
|
||||
|| (wp->w_match_head != NULL
|
||||
&& buf->b_mod_xlines != 0)
|
||||
#endif
|
||||
)))))
|
||||
))))
|
||||
#ifdef FEAT_SYN_HL
|
||||
|| (wp->w_p_cul && (lnum == wp->w_cursor.lnum
|
||||
|| lnum == wp->w_last_cursorline))
|
||||
#endif
|
||||
)
|
||||
{
|
||||
#ifdef FEAT_SEARCH_EXTRA
|
||||
if (lnum == mod_top)
|
||||
|
21
src/main.c
21
src/main.c
@@ -1380,26 +1380,19 @@ main_loop(
|
||||
validate_cursor();
|
||||
|
||||
#ifdef FEAT_SYN_HL
|
||||
if (curwin->w_p_cul && curwin->w_p_wrap
|
||||
&& (curwin->w_p_culopt_flags & CULOPT_SCRLINE))
|
||||
must_redraw = NOT_VALID;
|
||||
// Might need to update for 'cursorline'.
|
||||
// When 'cursorlineopt' is "screenline" need to redraw always.
|
||||
if (curwin->w_p_cul
|
||||
&& (curwin->w_last_cursorline != curwin->w_cursor.lnum
|
||||
|| (curwin->w_p_culopt_flags & CULOPT_SCRLINE))
|
||||
&& !char_avail())
|
||||
redraw_later(VALID);
|
||||
#endif
|
||||
|
||||
if (VIsual_active)
|
||||
update_curbuf(INVERTED); // update inverted part
|
||||
else if (must_redraw)
|
||||
{
|
||||
mch_disable_flush(); // Stop issuing gui_mch_flush().
|
||||
#ifdef FEAT_SYN_HL
|
||||
// Might need some more update for the cursorscreen line.
|
||||
// TODO: can we optimize this?
|
||||
if (curwin->w_p_cul
|
||||
&& curwin->w_p_wrap
|
||||
&& (curwin->w_p_culopt_flags & CULOPT_SCRLINE)
|
||||
&& !char_avail())
|
||||
update_screen(VALID);
|
||||
else
|
||||
#endif
|
||||
update_screen(0);
|
||||
mch_enable_flush();
|
||||
}
|
||||
|
@@ -17,4 +17,4 @@
|
||||
| +0#0000e05#a8a8a8255@3| +0#af5f00255#ffffff0@3|>+0#4040ff13&|i+0#0000000&|n|s|-+0#0000e05&|z+0#0000000&|w|e|i|-+0#0000e05&|d+0#0000000&|r|e|i|-+0#0000e05&|v+0#0000000&|i||+1&&|~+0#4040ff13&| @47
|
||||
| +0#0000e05#a8a8a8255@3| +0#af5f00255#ffffff0@3|>+0#4040ff13&|e+0#0000000&|r|-+0#0000e05&|f+0#0000000&|ü|n|f|-+0#0000e05&|s+0#0000000&|e|c|h|s|@+0#4040ff13&@2||+1#0000000&|~+0#4040ff13&| @47
|
||||
|<+3#0000000&|o| |N|a|m|e|]| |[|+|]| |1|,|1| @5|T|o|p| |[+1&&|N|o| |N|a|m|e|]| |[|+|]| @17|5|,|0|-|1| @9|B|o|t
|
||||
|:+0&&|s|e|t| |b|r|e|a|k|i|n|d|e|n|t| |f|o|l|d|c|o|l|u|m|n|=|2| |s|i|g|n|c|o|l|u|m|n|=|y|e|s| @30
|
||||
| +0&&@74
|
||||
|
@@ -17,4 +17,4 @@
|
||||
| +0#0000e05#a8a8a8255@3| +0#af5f00255#ffffff0@3|>+0#4040ff13&|i+0#0000000&|n|s|-+0#0000e05&|z+0#0000000&|w|e|i|-+0#0000e05&|d+0#0000000&|r|e|i|-+0#0000e05&|v+0#0000000&|i||+1&&|~+0#4040ff13&| @47
|
||||
| +0#0000e05#a8a8a8255@3| +0#af5f00255#ffffff0@3|>+0#4040ff13&|e+0#0000000&|r|-+0#0000e05&|f+0#0000000&|ü|n|f|-+0#0000e05&|s+0#0000000&|e|c|h|s|@+0#4040ff13&@2||+1#0000000&|~+0#4040ff13&| @47
|
||||
|<+3#0000000&|o| |N|a|m|e|]| |[|+|]| |1|,|2|6|-|3|0| @1|T|o|p| |[+1&&|N|o| |N|a|m|e|]| |[|+|]| @17|5|,|0|-|1| @9|B|o|t
|
||||
|:+0&&|s|e|t| |b|r|e|a|k|i|n|d|e|n|t| |f|o|l|d|c|o|l|u|m|n|=|2| |s|i|g|n|c|o|l|u|m|n|=|y|e|s| @30
|
||||
| +0&&@74
|
||||
|
@@ -17,4 +17,4 @@
|
||||
| +0#0000e05#a8a8a8255@3| +0#af5f00255#ffffff0@3|>+0#4040ff13&|i+0#0000000&|n|s|-+0#0000e05&|z+0#0000000&|w|e|i|-+0#0000e05&|d+0#0000000&|r|e|i|-+0#0000e05&|v+0#0000000&|i||+1&&|~+0#4040ff13&| @47
|
||||
| +0#0000e05#a8a8a8255@3| +0#af5f00255#ffffff0@3|>+0#4040ff13&|e+0#0000000&|r|-+0#0000e05&|f+0#0000000&|ü|n|f|-+0#0000e05&|s+0#0000000&|e|c|h|s|@+0#4040ff13&@2||+1#0000000&|~+0#4040ff13&| @47
|
||||
|<+3#0000000&|o| |N|a|m|e|]| |[|+|]| |1|,|4|3|-|4|7| @1|T|o|p| |[+1&&|N|o| |N|a|m|e|]| |[|+|]| @17|5|,|0|-|1| @9|B|o|t
|
||||
|:+0&&|s|e|t| |b|r|e|a|k|i|n|d|e|n|t| |f|o|l|d|c|o|l|u|m|n|=|2| |s|i|g|n|c|o|l|u|m|n|=|y|e|s| @30
|
||||
| +0&&@74
|
||||
|
@@ -17,4 +17,4 @@
|
||||
| +0#0000e05#a8a8a8255@3| +0#af5f00255#ffffff0@3|>+0#4040ff13&|i+0#0000000&|n|s|-+0#0000e05&|z+0#0000000&|w|e|i|-+0#0000e05&|d+0#0000000&|r|e|i|-+0#0000e05&|v+0#0000000&|i||+1&&|~+0#4040ff13&| @47
|
||||
| +0#0000e05#a8a8a8255@3| +0#af5f00255#ffffff0@3|>+0#4040ff13&|e+0#0000000&|r|-+0#0000e05&|f+0#0000000&|ü|n|f|-+0#0000e05&|s+0#0000000&|e|c|h|s|@+0#4040ff13&@2||+1#0000000&|~+0#4040ff13&| @47
|
||||
|<+3#0000000&|o| |N|a|m|e|]| |[|+|]| |1|,|5|9|-|6|4| @1|T|o|p| |[+1&&|N|o| |N|a|m|e|]| |[|+|]| @17|5|,|0|-|1| @9|B|o|t
|
||||
|:+0&&|s|e|t| |b|r|e|a|k|i|n|d|e|n|t| |f|o|l|d|c|o|l|u|m|n|=|2| |s|i|g|n|c|o|l|u|m|n|=|y|e|s| @30
|
||||
| +0&&@74
|
||||
|
@@ -17,4 +17,4 @@
|
||||
| +0#0000e05#a8a8a8255@3| +0#af5f00255#ffffff0@3|>+0#4040ff13&|i+0#0000000&|n|s|-+0#0000e05&|z+0#0000000&|w|e|i|-+0#0000e05&|d+0#0000000&|r|e|i|-+0#0000e05&|v+0#0000000&|i||+1&&|~+0#4040ff13&| @47
|
||||
| +0#0000e05#a8a8a8255@3| +0#af5f00255#ffffff0@3|>+0#4040ff13&|e+0#0000000&|r|-+0#0000e05&|f+0#0000000&|ü|n|f|-+0#0000e05&|s+0#0000000&|e|c|h|s|@+0#4040ff13&@2||+1#0000000&|~+0#4040ff13&| @47
|
||||
|<+3#0000000&|o| |N|a|m|e|]| |[|+|]| |1|,|7|5|-|8|1| @1|T|o|p| |[+1&&|N|o| |N|a|m|e|]| |[|+|]| @17|5|,|0|-|1| @9|B|o|t
|
||||
|:+0&&|s|e|t| |b|r|e|a|k|i|n|d|e|n|t| |f|o|l|d|c|o|l|u|m|n|=|2| |s|i|g|n|c|o|l|u|m|n|=|y|e|s| @30
|
||||
| +0&&@74
|
||||
|
@@ -17,4 +17,4 @@
|
||||
| +0#0000e05#a8a8a8255@3| +0#af5f00255#ffffff0@3|>+0#4040ff13&|i+0#0000000&|n|s|-+0#0000e05&|z+0#0000000&|w|e|i|-+0#0000e05&|d+0#0000000&|r|e|i|-+0#0000e05&|v+0#0000000&|i||+1&&|~+0#4040ff13&| @47
|
||||
| +0#0000e05#a8a8a8255@3| +0#af5f00255#ffffff0@3|>+0#4040ff13&|e+0#0000000&|r|-+0#0000e05&|f+0#0000000&|ü|n|f|-+0#0000e05&|s+0#0000000&|e|c|h|s|@+0#4040ff13&@2||+1#0000000&|~+0#4040ff13&| @47
|
||||
|<+3#0000000&|o| |N|a|m|e|]| |[|+|]| |1|,|9|1|-|9|8| @1|T|o|p| |[+1&&|N|o| |N|a|m|e|]| |[|+|]| @17|5|,|0|-|1| @9|B|o|t
|
||||
|:+0&&|s|e|t| |b|r|e|a|k|i|n|d|e|n|t| |f|o|l|d|c|o|l|u|m|n|=|2| |s|i|g|n|c|o|l|u|m|n|=|y|e|s| @30
|
||||
| +0&&@74
|
||||
|
@@ -741,6 +741,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
2214,
|
||||
/**/
|
||||
2213,
|
||||
/**/
|
||||
|
Reference in New Issue
Block a user