On 17 July 2014, Bram Moolenaar <b...@moolenaar.net> wrote:
> 
> Lce wrote:
> 
> >     As stated in the subject: calling setqflist(list 'r') kills the
> > title of the quickfix window.  Patch attached.
> 
> Thanks.  Could you also write a test for this?

    Updated patch attached below.

    /lcd

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
diff --git a/src/quickfix.c b/src/quickfix.c
--- a/src/quickfix.c
+++ b/src/quickfix.c
@@ -895,7 +895,7 @@
     int                i;
 
     /*
-     * If the current entry is not the last entry, delete entries below
+     * If the current entry is not the last entry, delete entries beyond
      * the current entry.  This makes it possible to browse in a tree-like
      * way with ":grep'.
      */
@@ -3845,7 +3845,17 @@
             prevp->qf_next != prevp; prevp = prevp->qf_next)
            ;
     else if (action == 'r')
+    {
        qf_free(qi, qi->qf_curlist);
+       if (title != NULL)
+       {
+           char_u *p = alloc((int)STRLEN(title) + 2);
+
+           qi->qf_lists[qi->qf_curlist].qf_title = p;
+           if (p != NULL)
+               sprintf((char *)p, ":%s", (char *)title);
+       }
+    }
 
     for (li = list->lv_first; li != NULL; li = li->li_next)
     {
diff --git a/src/testdir/Make_amiga.mak b/src/testdir/Make_amiga.mak
--- a/src/testdir/Make_amiga.mak
+++ b/src/testdir/Make_amiga.mak
@@ -35,7 +35,7 @@
                test89.out test90.out test91.out test92.out test93.out \
                test94.out test95.out test96.out test97.out test98.out \
                test99.out test100.out test101.out test102.out test103.out \
-               test104.out test105.out test106.out test107.out \
+               test104.out test105.out test106.out test107.out test108.out \
                test_autoformat_join.out \
                test_breakindent.out \
                test_listlbr.out \
diff --git a/src/testdir/Make_dos.mak b/src/testdir/Make_dos.mak
--- a/src/testdir/Make_dos.mak
+++ b/src/testdir/Make_dos.mak
@@ -34,7 +34,7 @@
                test89.out test90.out test91.out test92.out test93.out \
                test94.out test95.out test96.out test98.out test99.out \
                test100.out test101.out test102.out test103.out test104.out \
-               test105.out test106.out  test107.out\
+               test105.out test106.out test107.out test108.out \
                test_autoformat_join.out \
                test_breakindent.out \
                test_listlbr.out \
diff --git a/src/testdir/Make_ming.mak b/src/testdir/Make_ming.mak
--- a/src/testdir/Make_ming.mak
+++ b/src/testdir/Make_ming.mak
@@ -54,7 +54,7 @@
                test89.out test90.out test91.out test92.out test93.out \
                test94.out test95.out test96.out test98.out test99.out \
                test100.out test101.out test102.out test103.out test104.out \
-               test105.out test106.out test107.out \
+               test105.out test106.out test107.out test108.out \
                test_autoformat_join.out \
                test_breakindent.out \
                test_listlbr.out \
diff --git a/src/testdir/Make_os2.mak b/src/testdir/Make_os2.mak
--- a/src/testdir/Make_os2.mak
+++ b/src/testdir/Make_os2.mak
@@ -36,7 +36,7 @@
                test89.out test90.out test91.out test92.out test93.out \
                test94.out test95.out test96.out test98.out test99.out \
                test100.out test101.out test102.out test103.out test104.out \
-               test105.out test106.out test107.out \
+               test105.out test106.out test107.out test108.out \
                test_autoformat_join.out \
                test_eval.out \
                test_breakindent.out \
diff --git a/src/testdir/Make_vms.mms b/src/testdir/Make_vms.mms
--- a/src/testdir/Make_vms.mms
+++ b/src/testdir/Make_vms.mms
@@ -95,7 +95,7 @@
         test90.out test91.out test92.out test93.out test94.out \
         test95.out test96.out test98.out test99.out \
         test100.out test101.out test103.out test104.out \
-        test105.out test106.out test107.out \
+        test105.out test106.out test107.out test108.out \
         test_autoformat_join.out \
         test_breakindent.out \
         test_listlbr.out \
diff --git a/src/testdir/Makefile b/src/testdir/Makefile
--- a/src/testdir/Makefile
+++ b/src/testdir/Makefile
@@ -32,7 +32,7 @@
                test89.out test90.out test91.out test92.out test93.out \
                test94.out test95.out test96.out test97.out test98.out \
                test99.out test100.out test101.out test102.out test103.out \
-               test104.out test105.out test106.out test107.out \
+               test104.out test105.out test106.out test107.out test108.out \
                test_autoformat_join.out \
                test_breakindent.out \
                test_listlbr.out \
diff --git a/src/testdir/test108.in b/src/testdir/test108.in
new file mode 100644
--- /dev/null
+++ b/src/testdir/test108.in
@@ -0,0 +1,18 @@
+Tests for quickfix window's title     vim: set ft=vim :
+
+STARTTEST
+:so small.vim
+:if !has('quickfix') | e! test.ok | wq! test.out | endif
+:set efm=%E%f:%l:%c:%m
+:cgetexpr ['file:1:1:message']
+:let qflist=getqflist()
+:call setqflist(qflist, 'r')
+:copen
+:let g:quickfix_title=w:quickfix_title
+:wincmd p
+:$put =g:quickfix_title
+:/^Results/,$w test.out
+:qa!
+ENDTEST
+
+Results of test108:
diff --git a/src/testdir/test108.ok b/src/testdir/test108.ok
new file mode 100644
--- /dev/null
+++ b/src/testdir/test108.ok
@@ -0,0 +1,2 @@
+Results of test108:
+:setqflist()

Raspunde prin e-mail lui