Hi glts!
On Mi, 27 Mär 2013, glts wrote:
> I still don't think it should be an error. Sometimes when you start
> typing "d3..." you realize you wanted "change" instead of "delete", so
> you press <Esc> and start again.
>
> For me, "d:call <Esc>" is the same thing. Perhaps you want to use a
> custom function but you forgot to source the relevant file, so you
> cancel and start again. I don't feel this is an error. What do you
> think?
Ok, what do you think of this updated patch?
regards,
Christian
--
"Verstehen sie etwas vom Theater?"
"Ja, wenn laut genug gesprochen wird."
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.
diff --git a/src/normal.c b/src/normal.c
--- a/src/normal.c
+++ b/src/normal.c
@@ -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,12 +5462,16 @@
restart_edit = 0;
}
+ if (cmd_result == FAIL)
+ clearop(cap->oap);
/* The start of the operator may have become invalid by the Ex
* command. */
- if (cap->oap->op_type != OP_NOP
+ 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
+ ))
clearopbeep(cap->oap);
}
}