mirror of
https://github.com/neovim/neovim.git
synced 2025-10-03 00:18:33 +00:00
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)
18f4740f04
{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.
This commit is contained in:
@@ -989,18 +989,16 @@ Object copy_object(Object obj)
|
||||
static void set_option_value_for(char *key, int numval, char *stringval, int opt_flags,
|
||||
int opt_type, void *from, Error *err)
|
||||
{
|
||||
win_T *save_curwin = NULL;
|
||||
tabpage_T *save_curtab = NULL;
|
||||
switchwin_T switchwin;
|
||||
aco_save_T aco;
|
||||
|
||||
try_start();
|
||||
switch (opt_type)
|
||||
{
|
||||
case SREQ_WIN:
|
||||
if (switch_win_noblock(&save_curwin, &save_curtab, (win_T *)from,
|
||||
win_find_tabpage((win_T *)from), true)
|
||||
if (switch_win_noblock(&switchwin, (win_T *)from, win_find_tabpage((win_T *)from), true)
|
||||
== FAIL) {
|
||||
restore_win_noblock(save_curwin, save_curtab, true);
|
||||
restore_win_noblock(&switchwin, true);
|
||||
if (try_end(err)) {
|
||||
return;
|
||||
}
|
||||
@@ -1010,7 +1008,7 @@ static void set_option_value_for(char *key, int numval, char *stringval, int opt
|
||||
return;
|
||||
}
|
||||
set_option_value_err(key, numval, stringval, opt_flags, err);
|
||||
restore_win_noblock(save_curwin, save_curtab, true);
|
||||
restore_win_noblock(&switchwin, true);
|
||||
break;
|
||||
case SREQ_BUF:
|
||||
aucmd_prepbuf(&aco, (buf_T *)from);
|
||||
|
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user