diff -r acf7368a2acc src/normal.c
--- a/src/normal.c	Thu Mar 21 22:53:50 2013 +0100
+++ b/src/normal.c	Thu Mar 28 13:10:01 2013 +0100
@@ -5418,6 +5418,7 @@
     cmdarg_T  *cap;
 {
     int	    old_p_im;
+    int	    cmd_result;
 
 #ifdef FEAT_VISUAL
     if (VIsual_active)
@@ -5449,7 +5450,7 @@
 	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 */
@@ -5461,13 +5462,18 @@
 		restart_edit = 0;
 	}
 
-	/* The start of the operator may have become invalid by the Ex
-	 * command. */
-	if (cap->oap->op_type != OP_NOP
-		&& (cap->oap->start.lnum > curbuf->b_ml.ml_line_count
+	if (cap->oap->op_type != OP_NOP)
+	{
+	    /* The start of the operator may have become invalid by the Ex
+	     * command. */
+	    if (cap->oap->start.lnum > curbuf->b_ml.ml_line_count
 		    || cap->oap->start.col >
-			       (colnr_T)STRLEN(ml_get(cap->oap->start.lnum))))
-	    clearopbeep(cap->oap);
+			       (colnr_T)STRLEN(ml_get(cap->oap->start.lnum))
+		    || did_emsg)
+		clearopbeep(cap->oap);
+	    else if (cmd_result == FAIL)
+		clearop(cap->oap);
+	}
     }
 }
 
