aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/window.c
diff options
context:
space:
mode:
authorSean Dewar <seandewar@users.noreply.github.com>2022-01-06 13:48:37 +0000
committerSean Dewar <seandewar@users.noreply.github.com>2022-02-03 15:02:57 +0000
commitf326c9a77da3aef052ce6af0f851344f2479c844 (patch)
treecbfedb742e02d31852fed6c20a54fd78aaf289f0 /src/nvim/api/window.c
parentf5c4c1d7684d9d39dd469e10322ce6a5df5c3281 (diff)
downloadrneovim-f326c9a77da3aef052ce6af0f851344f2479c844.tar.gz
rneovim-f326c9a77da3aef052ce6af0f851344f2479c844.tar.bz2
rneovim-f326c9a77da3aef052ce6af0f851344f2479c844.zip
vim-patch:8.2.4018: ml_get error when win_execute redraws with Visual selection
Problem: ml_get error when win_execute redraws with Visual selection. Solution: Disable Visual area temporarily. (closes vim/vim#9479) https://github.com/vim/vim/commit/18f4740f043b353abe47b7a00131317052457686 {switch_to/restore}_win_for_buf is N/A (marked as such in v8.0.0860; currently only used in Vim's if_py). Add a modeline to test_execute_func.vim.
Diffstat (limited to 'src/nvim/api/window.c')
-rw-r--r--src/nvim/api/window.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/nvim/api/window.c b/src/nvim/api/window.c
index 907306da7b..a762673fbf 100644
--- a/src/nvim/api/window.c
+++ b/src/nvim/api/window.c
@@ -455,17 +455,14 @@ Object nvim_win_call(Window window, LuaRef fun, Error *err)
}
tabpage_T *tabpage = win_find_tabpage(win);
- win_T *save_curwin;
- tabpage_T *save_curtab;
-
try_start();
Object res = OBJECT_INIT;
- if (switch_win_noblock(&save_curwin, &save_curtab, win, tabpage, true) ==
- OK) {
+ switchwin_T switchwin;
+ if (switch_win_noblock(&switchwin, win, tabpage, true) == OK) {
Array args = ARRAY_DICT_INIT;
res = nlua_call_ref(fun, NULL, args, true, err);
}
- restore_win_noblock(save_curwin, save_curtab, true);
+ restore_win_noblock(&switchwin, true);
try_end(err);
return res;
}