Skip to content

Commit

Permalink
updated for version 7.3.879
Browse files Browse the repository at this point in the history
Problem:    When using an ex command in operator pending mode, using Esc to
            abort the command still executes the operator. (David Bürgin)
Solution:   Clear the operator when the ex command fails. (Christian Brabandt)
  • Loading branch information
brammool committed Apr 5, 2013
1 parent 91fc43d commit d7fbfe1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/normal.c
Expand Up @@ -5418,6 +5418,7 @@ nv_colon(cap)
cmdarg_T *cap;
{
int old_p_im;
int cmd_result;

#ifdef FEAT_VISUAL
if (VIsual_active)
Expand Down Expand Up @@ -5449,7 +5450,7 @@ nv_colon(cap)
old_p_im = p_im;

/* get a command line and execute it */
do_cmdline(NULL, getexline, NULL,
cmd_result = do_cmdline(NULL, getexline, NULL,
cap->oap->op_type != OP_NOP ? DOCMD_KEEPLINE : 0);

/* If 'insertmode' changed, enter or exit Insert mode */
Expand All @@ -5461,12 +5462,17 @@ nv_colon(cap)
restart_edit = 0;
}

/* The start of the operator may have become invalid by the Ex
* command. */
if (cap->oap->op_type != OP_NOP
if (cmd_result == FAIL)
/* The Ex command failed, do not execute the operator. */
clearop(cap->oap);
else if (cap->oap->op_type != OP_NOP
&& (cap->oap->start.lnum > curbuf->b_ml.ml_line_count
|| cap->oap->start.col >
(colnr_T)STRLEN(ml_get(cap->oap->start.lnum))))
(colnr_T)STRLEN(ml_get(cap->oap->start.lnum))
|| did_emsg
))
/* The start of the operator has become invalid by the Ex command.
*/
clearopbeep(cap->oap);
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -728,6 +728,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
879,
/**/
878,
/**/
Expand Down

0 comments on commit d7fbfe1

Please sign in to comment.