diff src/quickfix.c @ 8603:bfa74b84c41c v7.4.1591

commit https://github.com/vim/vim/commit/5584df65a0ca2315d1eebc13c54a448bee4d0758 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Mar 18 21:00:51 2016 +0100 patch 7.4.1591 Problem: The quickfix title is truncated. Solution: Save the command before it is truncated. (Anton Lindqvist)
author Christian Brabandt <cb@256bit.org>
date Fri, 18 Mar 2016 21:15:04 +0100
parents c079097365f3
children 536b9b88d1ca
line wrap: on
line diff
--- a/src/quickfix.c
+++ b/src/quickfix.c
@@ -3286,6 +3286,7 @@ ex_vimgrep(exarg_T *eap)
     int		fcount;
     char_u	**fnames;
     char_u	*fname;
+    char_u	*title;
     char_u	*s;
     char_u	*p;
     int		fi;
@@ -3354,6 +3355,7 @@ ex_vimgrep(exarg_T *eap)
 
     /* Get the search pattern: either white-separated or enclosed in // */
     regmatch.regprog = NULL;
+    title = vim_strsave(*eap->cmdlinep);
     p = skip_vimgrep_pat(eap->arg, &s, &flags);
     if (p == NULL)
     {
@@ -3390,7 +3392,7 @@ ex_vimgrep(exarg_T *eap)
 	 eap->cmdidx != CMD_vimgrepadd && eap->cmdidx != CMD_lvimgrepadd)
 					|| qi->qf_curlist == qi->qf_listcount)
 	/* make place for a new list */
-	qf_new_list(qi, *eap->cmdlinep);
+	qf_new_list(qi, title != NULL ? title : *eap->cmdlinep);
     else if (qi->qf_lists[qi->qf_curlist].qf_count > 0)
 	/* Adding to existing list, find last entry. */
 	for (prevp = qi->qf_lists[qi->qf_curlist].qf_start;
@@ -3669,6 +3671,7 @@ ex_vimgrep(exarg_T *eap)
     }
 
 theend:
+    vim_free(title);
     vim_free(dirname_now);
     vim_free(dirname_start);
     vim_free(target_dir);