This patch fixes a problem with w:quickfix_title keeping the old value
when a new command produces a quickfix list.
E.g. if you perform
:lgrep foo
:lopen
:lmake bar
the quickfix window will still display :lgrep foo.
I also modified test10 to check whether w:quickfix_title is updated.
--
Cheers,
Lech
--
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
diff --git a/src/quickfix.c b/src/quickfix.c
index 82826b2..a0284e5 100644
--- a/src/quickfix.c
+++ b/src/quickfix.c
@@ -2526,6 +2526,8 @@ qf_update_buffer(qi)
qf_info_T *qi;
{
buf_T *buf;
+ win_T *win;
+ win_T *curwin_save;
aco_save_T aco;
/* Check if a buffer for the quickfix list exists. Update it. */
@@ -2537,6 +2539,17 @@ qf_update_buffer(qi)
qf_fill_buffer(qi);
+ if (qi->qf_lists[qi->qf_curlist].qf_title != NULL
+ && (win = qf_find_win(qi)) != NULL)
+ {
+ curwin_save = curwin;
+ curwin = win;
+ set_internal_string_var((char_u *)"w:quickfix_title",
+ qi->qf_lists[qi->qf_curlist].qf_title);
+ curwin = curwin_save;
+
+ }
+
/* restore curwin/curbuf and a few other things */
aucmd_restbuf(&aco);
diff --git a/src/testdir/test10.in b/src/testdir/test10.in
index 6d0c721..5401058 100644
--- a/src/testdir/test10.in
+++ b/src/testdir/test10.in
@@ -2,9 +2,16 @@ Test for 'errorformat'. This will fail if the quickfix feature was disabled.
STARTTEST
:so small.vim
-:/start of errorfile/,/end of errorfile/w! Xerrorfile
+:7/start of errorfile/,/end of errorfile/w! Xerrorfile1
+:7/start of errorfile/,/end of errorfile/-1w! Xerrorfile2
:/start of testfile/,/end of testfile/w! Xtestfile
-:cf Xerrorfile
+:cf Xerrorfile2
+:clast
+:copen
+:let a=w:quickfix_title
+:wincmd p
+gR=a
+:cf Xerrorfile1
rA
:cn
rB
@@ -14,6 +21,11 @@ rC
rD
:cn
rE
+:cn
+:wincmd w
+:let a=w:quickfix_title
+:wincmd p
+gR=a
:w! test.out " Write contents of this file
:qa!
ENDTEST
@@ -30,6 +42,8 @@ in file "Xtestfile" linenr 16: there is an error
"Xtestfile", linenr 19: yet another problem
Does anyone know what is the problem and how to correction it?
+"Xtestfile", line 21 col 9: What is the title of the quickfix window?
+"Xtestfile", line 22 col 9: What is the title of the quickfix window?
end of errorfile
start of testfile
diff --git a/src/testdir/test10.ok b/src/testdir/test10.ok
index 2c86889..01d47e8 100644
--- a/src/testdir/test10.ok
+++ b/src/testdir/test10.ok
@@ -18,6 +18,6 @@ line 17 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
line 18 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Eine 19 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
line 20 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-line 21 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-line 22 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 21 :cf Xerrorfile1xxxxxxxxxxxxxxx
+line 22 :cf Xerrorfile2xxxxxxxxxxxxxxx
end of testfile