summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-03-18 21:00:51 +0100
committerBram Moolenaar <Bram@vim.org>2016-03-18 21:00:51 +0100
commit5584df65a0ca2315d1eebc13c54a448bee4d0758 (patch)
tree496f385985c5f9a36945328c3b8ca3d4395f587c /src
parent3f242a844e83a5a04943869f6e3bcbf8650dc465 (diff)
patch 7.4.1591v7.4.1591
Problem: The quickfix title is truncated. Solution: Save the command before it is truncated. (Anton Lindqvist)
Diffstat (limited to 'src')
-rw-r--r--src/quickfix.c5
-rw-r--r--src/testdir/test_quickfix.vim17
-rw-r--r--src/version.c2
3 files changed, 23 insertions, 1 deletions
diff --git a/src/quickfix.c b/src/quickfix.c
index eb6433eaf9..8dfad2ec84 100644
--- 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);
diff --git a/src/testdir/test_quickfix.vim b/src/testdir/test_quickfix.vim
index d551febdf5..5982aeef1b 100644
--- a/src/testdir/test_quickfix.vim
+++ b/src/testdir/test_quickfix.vim
@@ -317,6 +317,23 @@ func Test_errortitle()
augroup! QfBufWinEnter
endfunc
+func Test_vimgreptitle()
+ augroup QfBufWinEnter
+ au!
+ au BufWinEnter * :let g:a=get(w:, 'quickfix_title', 'NONE')
+ augroup END
+ try
+ vimgrep /pattern/j file
+ catch /E480/
+ endtry
+ copen
+ call assert_equal(': vimgrep /pattern/j file', g:a)
+ augroup QfBufWinEnter
+ au!
+ augroup END
+ augroup! QfBufWinEnter
+endfunc
+
function XqfTitleTests(cchar)
let Xgetexpr = a:cchar . 'getexpr'
if a:cchar == 'c'
diff --git a/src/version.c b/src/version.c
index a64d6080ff..f2e7d67fcd 100644
--- a/src/version.c
+++ b/src/version.c
@@ -749,6 +749,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1591,
+/**/
1590,
/**/
1589,