0
0
mirror of https://github.com/vim/vim.git synced 2025-09-27 04:14:06 -04:00

updated for version 7.3.481

Problem:    Changing 'virtualedit' in an operator function to "all" does not
            have the desired effect. (Aaron Bohannon)
Solution:   Save, reset and restore virtual_op when executing an operator
            function.
This commit is contained in:
Bram Moolenaar
2012-03-28 12:59:57 +02:00
parent 970a1b82ec
commit 61d281a4c0
2 changed files with 10 additions and 0 deletions

View File

@@ -2279,6 +2279,7 @@ op_function(oap)
{ {
#ifdef FEAT_EVAL #ifdef FEAT_EVAL
char_u *(argv[1]); char_u *(argv[1]);
int save_virtual_op = virtual_op;
if (*p_opfunc == NUL) if (*p_opfunc == NUL)
EMSG(_("E774: 'operatorfunc' is empty")); EMSG(_("E774: 'operatorfunc' is empty"));
@@ -2297,7 +2298,14 @@ op_function(oap)
argv[0] = (char_u *)"line"; argv[0] = (char_u *)"line";
else else
argv[0] = (char_u *)"char"; 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); (void)call_func_retnr(p_opfunc, 1, argv, FALSE);
virtual_op = save_virtual_op;
} }
#else #else
EMSG(_("E775: Eval feature not available")); EMSG(_("E775: Eval feature not available"));

View File

@@ -714,6 +714,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
481,
/**/ /**/
480, 480,
/**/ /**/