win_T *curwin_save;
buf_T *curbuf_save;
typval_T rettv;
+ int save_State = State;
funcname = (type == CTRL_X_FUNCTION) ? curbuf->b_p_cfu : curbuf->b_p_ofu;
if (*funcname == NUL)
ins_compl_add_dict(matchdict);
theend:
+ // Restore State, it might have been changed.
+ State = save_State;
+
if (matchdict != NULL)
dict_unref(matchdict);
if (matchlist != NULL)
pos_T pos;
win_T *curwin_save;
buf_T *curbuf_save;
+ int save_State = State;
/* Call 'completefunc' or 'omnifunc' and get pattern length as a
* string */
curwin_save = curwin;
curbuf_save = curbuf;
col = call_func_retnr(funcname, 2, args);
+
+ State = save_State;
if (curwin_save != curwin || curbuf_save != curbuf)
{
EMSG(_(e_complwin));
{
char_u *res;
char_u buf[MB_MAXBYTES + 1];
+ int save_State = State;
/* Return quickly when there is nothing to do. */
if (!has_insertcharpre())
set_vim_var_string(VV_CHAR, NULL, -1); /* clear v:char */
--textlock;
+ // Restore the State, it may have been changed.
+ State = save_State;
+
return res;
}
#endif
" It will be called after each Test_ function.
"
" When debugging a test it can be useful to add messages to v:errors:
-" call add(v:errors, "this happened")
+" call add(v:errors, "this happened")
" Without the +eval feature we can't run these tests, bail out.
endtry
endif
+ " In case 'insertmode' was set and something went wrong, make sure it is
+ " reset to avoid trouble with anything else.
+ set noinsertmode
+
if exists("*TearDown")
try
call TearDown()