diff options
author | jing <lhchenjw@gmail.com> | 2021-01-09 13:15:23 +0800 |
---|---|---|
committer | jing <lhchenjw@gmail.com> | 2021-05-06 23:45:16 +0800 |
commit | 1def3d1542d6a65f057e743faea39a760b50db87 (patch) | |
tree | 258028859694d4b43d992f8c9080eaab3268944c /src | |
parent | 03b3ff861082ff09f2903565d928187489225306 (diff) | |
download | rneovim-1def3d1542d6a65f057e743faea39a760b50db87.tar.gz rneovim-1def3d1542d6a65f057e743faea39a760b50db87.tar.bz2 rneovim-1def3d1542d6a65f057e743faea39a760b50db87.zip |
api/window: use the "noblock" variants in nvim_win_set_buf
after commit 92c6383cdca977("vim-patch:8.1.1425: win_execute() does not set window pointers properly"),
nvim_win_set_buf can use switch_win_noblock and restore_win_noblock.
It makes nvim_win_set_buf don't block autocmds so that it will be more
"without side-effects" as said in help text.
Signed-off-by: jing <lhchenjw@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/api/window.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/api/window.c b/src/nvim/api/window.c index 89fa2f86fb..5e2f03f007 100644 --- a/src/nvim/api/window.c +++ b/src/nvim/api/window.c @@ -54,7 +54,7 @@ void nvim_win_set_buf(Window window, Buffer buffer, Error *err) return; } - if (switch_win(&save_curwin, &save_curtab, win, tab, false) == FAIL) { + if (switch_win_noblock(&save_curwin, &save_curtab, win, tab, false) == FAIL) { api_set_error(err, kErrorTypeException, "Failed to switch to window %d", @@ -74,7 +74,7 @@ void nvim_win_set_buf(Window window, Buffer buffer, Error *err) // So do it now. validate_cursor(); - restore_win(save_curwin, save_curtab, false); + restore_win_noblock(save_curwin, save_curtab, false); } /// Gets the (1,0)-indexed cursor position in the window. |api-indexing| |