summaryrefslogtreecommitdiff
path: root/src/normal.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/normal.c')
-rw-r--r--src/normal.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/normal.c b/src/normal.c
index aa470e4f7..a7301162b 100644
--- a/src/normal.c
+++ b/src/normal.c
@@ -2279,6 +2279,7 @@ op_function(oap)
{
#ifdef FEAT_EVAL
char_u *(argv[1]);
+ int save_virtual_op = virtual_op;
if (*p_opfunc == NUL)
EMSG(_("E774: 'operatorfunc' is empty"));
@@ -2297,7 +2298,14 @@ op_function(oap)
argv[0] = (char_u *)"line";
else
argv[0] = (char_u *)"char";
+
+ /* Reset virtual_op so that 'virtualedit' can be changed in the
+ * function. */
+ virtual_op = MAYBE;
+
(void)call_func_retnr(p_opfunc, 1, argv, FALSE);
+
+ virtual_op = save_virtual_op;
}
#else
EMSG(_("E775: Eval feature not available"));