patch 7.4.2331
Problem: Using CTRL-X CTRL-V to complete a command line from Insert mode
does not work after entering an expression on the command line.
Solution: Don't use "ccline" when not actually using a command line. (test
by Hirohito Higashi)
diff --git a/src/ex_getln.c b/src/ex_getln.c
index ed82f0f..4ff9ae1 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -4509,7 +4509,7 @@
xp->xp_context = EXPAND_NOTHING;
return;
}
- set_cmd_context(xp, ccline.cmdbuff, ccline.cmdlen, ccline.cmdpos);
+ set_cmd_context(xp, ccline.cmdbuff, ccline.cmdlen, ccline.cmdpos, TRUE);
}
void
@@ -4517,7 +4517,8 @@
expand_T *xp,
char_u *str, /* start of command line */
int len, /* length of command line (excl. NUL) */
- int col) /* position of cursor */
+ int col, /* position of cursor */
+ int use_ccline UNUSED) /* use ccline for info */
{
int old_char = NUL;
char_u *nextcomm;
@@ -4532,14 +4533,14 @@
nextcomm = str;
#ifdef FEAT_EVAL
- if (ccline.cmdfirstc == '=')
+ if (use_ccline && ccline.cmdfirstc == '=')
{
# ifdef FEAT_CMDL_COMPL
/* pass CMD_SIZE because there is no real command */
set_context_for_expression(xp, str, CMD_SIZE);
# endif
}
- else if (ccline.input_fn)
+ else if (use_ccline && ccline.input_fn)
{
xp->xp_context = ccline.xp_context;
xp->xp_pattern = ccline.cmdbuff;