diff src/ex_getln.c @ 10120:fb040c9d8ce9 v7.4.2331

commit https://github.com/vim/vim/commit/33a80eeb859a78ba93432da6fa585786cfd77249 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Sep 5 21:51:14 2016 +0200 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)
author Christian Brabandt <cb@256bit.org>
date Mon, 05 Sep 2016 22:00:06 +0200
parents 72e4b7f90465
children b17c82587755
line wrap: on
line diff
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -4509,7 +4509,7 @@ set_expand_context(expand_T *xp)
 	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 @@ set_cmd_context(
     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 @@ set_cmd_context(
     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;