diff src/main.c @ 18068:1101eacc1444 v8.1.2029

patch 8.1.2029: cannot control 'cursorline' highlighting well Commit: https://github.com/vim/vim/commit/017ba07fa2cdc578245618717229444fd50c470d Author: Bram Moolenaar <Bram@vim.org> Date: Sat Sep 14 21:01:23 2019 +0200 patch 8.1.2029: cannot control 'cursorline' highlighting well Problem: Cannot control 'cursorline' highlighting well. Solution: Add "screenline". (Christian Brabandt, closes https://github.com/vim/vim/issues/4933)
author Bram Moolenaar <Bram@vim.org>
date Sat, 14 Sep 2019 21:15:04 +0200
parents af0b4ffab794
children a2870e6f5b45
line wrap: on
line diff
--- a/src/main.c
+++ b/src/main.c
@@ -1255,12 +1255,28 @@ main_loop(
 	    update_topline();
 	    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;
+#endif
+
 	    if (VIsual_active)
-		update_curbuf(INVERTED);/* update inverted part */
+		update_curbuf(INVERTED); // update inverted part
 	    else if (must_redraw)
 	    {
-		mch_disable_flush();	/* Stop issuing gui_mch_flush(). */
-		update_screen(0);
+		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();
 	    }
 	    else if (redraw_cmdline || clear_cmdline)