]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.0077: Unnecessary call to redraw_for_cursorline() in nv_mousescroll() v9.1.0077
authorzeertzjq <zeertzjq@outlook.com>
Tue, 6 Feb 2024 09:43:36 +0000 (10:43 +0100)
committerChristian Brabandt <cb@256bit.org>
Tue, 6 Feb 2024 09:43:36 +0000 (10:43 +0100)
Problem:  The call to redraw_for_cursorline() in nv_mousescroll() is
          unnecessary because redraw_for_cursorline() only sets redraw
          type to UPD_VALID, and all code paths in do_mousescroll()
          already set redraw type to at least UPD_VALID.
Solution: Remove call to redraw_for_cursorline() in nv_mousescroll().
          (zeertzjq)

closes: #13979

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/mouse.c
src/move.c
src/proto/move.pro
src/version.c

index b0db60f11f298dce01066cf59983620fe3c28eea..e5f06874f8deec2235fd81c35c7906492ea187c5 100644 (file)
@@ -2224,10 +2224,6 @@ nv_mousescroll(cmdarg_T *cap)
     // Call the common mouse scroll function shared with other modes.
     do_mousescroll(cap);
 
-#ifdef FEAT_SYN_HL
-    if (curwin != old_curwin && curwin->w_p_cul)
-       redraw_for_cursorline(curwin);
-#endif
     curwin->w_redr_status = TRUE;
     curwin = old_curwin;
     curbuf = curwin->w_buffer;
index 5d2fece63a77bcd4c178c0fbfdaca55c2c133795..9ea24c8ed247e4f9e893f8a703aaaa0b5244620f 100644 (file)
@@ -19,6 +19,7 @@
 
 #include "vim.h"
 
+static void redraw_for_cursorline(win_T *wp);
 static int scrolljump_value(void);
 static int check_top_offset(void);
 static void curs_rows(win_T *wp);
@@ -155,7 +156,7 @@ comp_botline(win_T *wp)
  * Redraw when w_cline_row changes and 'relativenumber' or 'cursorline' is
  * set.
  */
-    void
+    static void
 redraw_for_cursorline(win_T *wp)
 {
     if ((wp->w_p_rnu
index b96b86d0fa6e93792a48fb6779ff2fde874ed441..bc9c025635dbaf162a951453ebc7a25a085844a8 100644 (file)
@@ -1,6 +1,5 @@
 /* move.c */
 int adjust_plines_for_skipcol(win_T *wp);
-void redraw_for_cursorline(win_T *wp);
 int sms_marker_overlap(win_T *wp, int extra2);
 void update_topline_redraw(void);
 void update_topline(void);
index efde1b57f83e7e35d87b970fa39049ee49194c51..3e4102da9e2fd849602d44003658598fe5075b3b 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    77,
 /**/
     76,
 /**/