]> granicus.if.org Git - vim/commitdiff
patch 8.1.2214: too much is redrawn when 'cursorline' is set v8.1.2214
authorBram Moolenaar <Bram@vim.org>
Thu, 24 Oct 2019 20:32:31 +0000 (22:32 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 24 Oct 2019 20:32:31 +0000 (22:32 +0200)
Problem:    Too much is redrawn when 'cursorline' is set.
Solution:   Don't do a complete redraw. (closes #5079)

src/change.c
src/drawscreen.c
src/main.c
src/testdir/dumps/Test_Xcursorline_13.dump
src/testdir/dumps/Test_Xcursorline_14.dump
src/testdir/dumps/Test_Xcursorline_15.dump
src/testdir/dumps/Test_Xcursorline_16.dump
src/testdir/dumps/Test_Xcursorline_17.dump
src/testdir/dumps/Test_Xcursorline_18.dump
src/version.c

index da6a72b569dfa65d537c78b61ac81d80c72af67d..f2542810ef44975e619f2b1aa1c906255bba2412 100644 (file)
@@ -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
+           // Relative numbering may require updating more.
+           if (wp->w_p_rnu)
+               redraw_win_later(wp, SOME_VALID);
 #ifdef FEAT_SYN_HL
-                   || ((wp->w_p_cul && lnum <= wp->w_last_cursorline)
-                           || (wp->w_p_culopt_flags & CULOPT_SCRLINE))
+           // 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
-                   )
-               redraw_win_later(wp, SOME_VALID);
        }
     }
 
index f6776a1a18125cda0f256819a13f98b35ce80491..abf34b5e99963b2202e0aa103b2d60cf50520453 100644 (file)
@@ -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)
index 5545cc48a6eec747fcb0ab607addc9be1baa5f76..8001c3fbb7f3f74379c212a0d4a347d9b809ac38 100644 (file)
@@ -1380,27 +1380,20 @@ 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);
+               update_screen(0);
                mch_enable_flush();
            }
            else if (redraw_cmdline || clear_cmdline)
index 6ceb93a800f053c050a2cb4a0346810ac1cd40e3..710cdc987363d52fe1f42ebe6dcad5faf50327d6 100644 (file)
@@ -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
index e7379536a63ae931f1a83fbfa102d41a8da8bee4..fb8d56cdb1f5ff16640b6c0674d7ce05df81681a 100644 (file)
@@ -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
index b7ae563bb7ecee769f2bdc8a147c0e49caa8777c..1470bf7d66f5e16c6148860060e64afb2b36826c 100644 (file)
@@ -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
index b59e24a524d6b1cc03dd24c7b77e699a76125cac..e2b41fe07b14e35ae20068ee7ca11ce3a16d3812 100644 (file)
@@ -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
index 8f41c902234ece9dcaf1494d1b96c0c123ee09ac..47344c7cbe74f930022bdd342de38dd038cffc21 100644 (file)
@@ -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
index 974cea36316081b81d91aa0fd31a98990537068d..cea6538eec9712da52da1b1f713ab172e8370e13 100644 (file)
@@ -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
index 4cd05a874444efa18e133762c92c4344c730196f..77ce139f87317f05a6224f89f86d248214d3e975 100644 (file)
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2214,
 /**/
     2213,
 /**/