fix(api): nvim_win_set_cursor redraw cursorcolumn for non-current window (#21072)

fix #19063
this fixes the cursorcolumn not being redrawn for non-current windows in `nvim_win_set_cursor()`
This commit is contained in:
Jlll1
2022-11-17 00:18:31 +01:00
committed by GitHub
parent c404f9b4ba
commit fedf002cb3
3 changed files with 47 additions and 11 deletions

View File

@@ -118,8 +118,13 @@ void nvim_win_set_cursor(Window window, ArrayOf(Integer, 2) pos, Error *err)
// Make sure we stick in this column.
win->w_set_curswant = true;
// make sure cursor is in visible range even if win != curwin
update_topline_win(win);
// make sure cursor is in visible range and
// cursorcolumn and cursorline are updated even if win != curwin
switchwin_T switchwin;
switch_win(&switchwin, win, NULL, true);
update_topline(curwin);
validate_cursor();
restore_win(&switchwin, true);
redraw_later(win, UPD_VALID);
win->w_redr_status = true;