mirror of
				https://github.com/neovim/neovim.git
				synced 2025-11-04 01:34:25 +00:00 
			
		
		
		
	vim-patch:8.1.0856: when scrolling a window the cursorline is not always updated
Problem:    When scrolling a window other than the current one the cursorline
            highlighting is not always updated. (Jason Franklin)
Solution:   Call redraw_for_cursorline() after scrolling.  Only set
            w_last_cursorline when drawing the cursor line.  Reset the lines
            to be redrawn also when redrawing the whole window.
bbb5f8d4c2
			
			
This commit is contained in:
		@@ -103,7 +103,7 @@ void reset_cursorline(void)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Redraw when w_cline_row changes and 'relativenumber' or 'cursorline' is set.
 | 
			
		||||
static void redraw_for_cursorline(win_T *wp)
 | 
			
		||||
void redraw_for_cursorline(win_T *wp)
 | 
			
		||||
{
 | 
			
		||||
  if ((wp->w_p_rnu || win_cursorline_standout(wp))
 | 
			
		||||
      && (wp->w_valid & VALID_CROW) == 0
 | 
			
		||||
@@ -122,7 +122,6 @@ static void redraw_for_cursorline(win_T *wp)
 | 
			
		||||
      } else {
 | 
			
		||||
        redraw_win_later(wp, SOME_VALID);
 | 
			
		||||
      }
 | 
			
		||||
      wp->w_last_cursorline = wp->w_cursor.lnum;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -4038,6 +4038,9 @@ static void nv_mousescroll(cmdarg_T *cap)
 | 
			
		||||
  } else {
 | 
			
		||||
    mouse_scroll_horiz(cap->arg);
 | 
			
		||||
  }
 | 
			
		||||
  if (curwin != old_curwin && curwin->w_p_cul) {
 | 
			
		||||
    redraw_for_cursorline(curwin);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  curwin->w_redr_status = true;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user