To: vim_dev@googlegroups.com Subject: Patch 7.4.1591 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 7.4.1591 Problem: The quickfix title is truncated. Solution: Save the command before it is truncated. (Anton Lindqvist) Files: src/quickfix.c, src/testdir/test_quickfix.vim *** ../vim-7.4.1590/src/quickfix.c 2016-01-30 20:31:21.249607913 +0100 --- src/quickfix.c 2016-03-18 20:59:42.305413185 +0100 *************** *** 3286,3291 **** --- 3286,3292 ---- int fcount; char_u **fnames; char_u *fname; + char_u *title; char_u *s; char_u *p; int fi; *************** *** 3354,3359 **** --- 3355,3361 ---- /* 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,3396 **** 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); 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; --- 3392,3398 ---- eap->cmdidx != CMD_vimgrepadd && eap->cmdidx != CMD_lvimgrepadd) || qi->qf_curlist == qi->qf_listcount) /* make place for a new list */ ! 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,3674 **** --- 3671,3677 ---- } theend: + vim_free(title); vim_free(dirname_now); vim_free(dirname_start); vim_free(target_dir); *** ../vim-7.4.1590/src/testdir/test_quickfix.vim 2016-03-17 22:06:49.933452325 +0100 --- src/testdir/test_quickfix.vim 2016-03-18 20:53:25.493390619 +0100 *************** *** 317,322 **** --- 317,339 ---- 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' *** ../vim-7.4.1590/src/version.c 2016-03-18 19:39:20.936316539 +0100 --- src/version.c 2016-03-18 20:54:36.268643430 +0100 *************** *** 750,751 **** --- 750,753 ---- { /* Add new patch number below this line */ + /**/ + 1591, /**/ -- If bankers can count, how come they have eight windows and only four tellers? /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///