diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2019-04-08 12:26:30 +0200 |
---|---|---|
committer | Björn Linse <bjorn.linse@gmail.com> | 2019-04-08 12:39:08 +0200 |
commit | 344c69b66b19c76a0a7e9f07f591f063317943d7 (patch) | |
tree | ba7c3a976abc2be1a032c03923164ff6fef79bf7 /src/nvim/api/window.c | |
parent | 11bf89e3b58be1dd534b4ea49b1988150cf7d4b8 (diff) | |
download | rneovim-344c69b66b19c76a0a7e9f07f591f063317943d7.tar.gz rneovim-344c69b66b19c76a0a7e9f07f591f063317943d7.tar.bz2 rneovim-344c69b66b19c76a0a7e9f07f591f063317943d7.zip |
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.
Diffstat (limited to 'src/nvim/api/window.c')
-rw-r--r-- | src/nvim/api/window.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/nvim/api/window.c b/src/nvim/api/window.c index a68ae805e8..01cb9a6847 100644 --- a/src/nvim/api/window.c +++ b/src/nvim/api/window.c @@ -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); } |