api/window: validate cursor in nvim_win_set_buf

validate_cursor() is called regularly, but only for the current window.
When changing the buffer for a non-current window, we need to invoke it
in the context of that window.
This commit is contained in:
Björn Linse
2019-04-08 12:26:30 +02:00
parent 11bf89e3b5
commit 344c69b66b
2 changed files with 64 additions and 0 deletions

View File

@@ -67,6 +67,10 @@ void nvim_win_set_buf(Window window, Buffer buffer, Error *err)
buffer);
}
// If window is not current, state logic will not validate its cursor.
// So do it now.
validate_cursor();
restore_win(save_curwin, save_curtab, false);
}