summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/quickfix.c38
-rw-r--r--src/testdir/Make_amiga.mak2
-rw-r--r--src/testdir/Make_dos.mak1
-rw-r--r--src/testdir/Make_ming.mak1
-rw-r--r--src/testdir/Make_os2.mak3
-rw-r--r--src/testdir/Make_vms.mms3
-rw-r--r--src/testdir/Makefile1
-rw-r--r--src/testdir/test_qf_title.in18
-rw-r--r--src/testdir/test_qf_title.ok2
-rw-r--r--src/version.c2
10 files changed, 56 insertions, 15 deletions
diff --git a/src/quickfix.c b/src/quickfix.c
index 799421e7f..fc3a14481 100644
--- a/src/quickfix.c
+++ b/src/quickfix.c
@@ -107,6 +107,7 @@ struct efm_S
};
static int qf_init_ext __ARGS((qf_info_T *qi, char_u *efile, buf_T *buf, typval_T *tv, char_u *errorformat, int newlist, linenr_T lnumfirst, linenr_T lnumlast, char_u *qf_title));
+static void qf_store_title __ARGS((qf_info_T *qi, char_u *title));
static void qf_new_list __ARGS((qf_info_T *qi, char_u *qf_title));
static void ll_free_all __ARGS((qf_info_T **pqi));
static int qf_add_entry __ARGS((qf_info_T *qi, qfline_T **prevp, char_u *dir, char_u *fname, int bufnum, char_u *mesg, long lnum, int col, int vis_col, char_u *pattern, int nr, int type, int valid));
@@ -126,7 +127,7 @@ static int is_qf_win __ARGS((win_T *win, qf_info_T *qi));
static win_T *qf_find_win __ARGS((qf_info_T *qi));
static buf_T *qf_find_buf __ARGS((qf_info_T *qi));
static void qf_update_buffer __ARGS((qf_info_T *qi));
-static void qf_set_title __ARGS((qf_info_T *qi));
+static void qf_set_title_var __ARGS((qf_info_T *qi));
static void qf_fill_buffer __ARGS((qf_info_T *qi));
#endif
static char_u *get_mef_name __ARGS((void));
@@ -884,6 +885,21 @@ qf_init_end:
return retval;
}
+ static void
+qf_store_title(qi, title)
+ qf_info_T *qi;
+ char_u *title;
+{
+ 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);
+ }
+}
+
/*
* Prepare for adding a new quickfix list.
*/
@@ -895,7 +911,7 @@ qf_new_list(qi, qf_title)
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'.
*/
@@ -916,14 +932,7 @@ qf_new_list(qi, qf_title)
else
qi->qf_curlist = qi->qf_listcount++;
vim_memset(&qi->qf_lists[qi->qf_curlist], 0, (size_t)(sizeof(qf_list_T)));
- if (qf_title != NULL)
- {
- char_u *p = alloc((int)STRLEN(qf_title) + 2);
-
- qi->qf_lists[qi->qf_curlist].qf_title = p;
- if (p != NULL)
- sprintf((char *)p, ":%s", (char *)qf_title);
- }
+ qf_store_title(qi, qf_title);
}
/*
@@ -2444,7 +2453,7 @@ ex_copen(eap)
qf_fill_buffer(qi);
if (qi->qf_lists[qi->qf_curlist].qf_title != NULL)
- qf_set_title(qi);
+ qf_set_title_var(qi);
curwin->w_cursor.lnum = qi->qf_lists[qi->qf_curlist].qf_index;
curwin->w_cursor.col = 0;
@@ -2599,7 +2608,7 @@ qf_update_buffer(qi)
{
curwin_save = curwin;
curwin = win;
- qf_set_title(qi);
+ qf_set_title_var(qi);
curwin = curwin_save;
}
@@ -2612,7 +2621,7 @@ qf_update_buffer(qi)
}
static void
-qf_set_title(qi)
+qf_set_title_var(qi)
qf_info_T *qi;
{
set_internal_string_var((char_u *)"w:quickfix_title",
@@ -3845,7 +3854,10 @@ set_errorlist(wp, list, action, title)
prevp->qf_next != prevp; prevp = prevp->qf_next)
;
else if (action == 'r')
+ {
qf_free(qi, qi->qf_curlist);
+ qf_store_title(qi, 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
index 60d820ab8..46cd6a90d 100644
--- a/src/testdir/Make_amiga.mak
+++ b/src/testdir/Make_amiga.mak
@@ -40,6 +40,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
test_breakindent.out \
test_listlbr.out \
test_listlbr_utf8.out \
+ test_qf_title.out \
test_eval.out \
test_options.out
@@ -169,5 +170,6 @@ test_autoformat_join.out: test_autoformat_join.in
test_breakindent.out: test_breakindent.in
test_listlbr.out: test_listlbr.in
test_listlbr_utf8.out: test_listlbr_utf8.in
+test_qf_title.out: test_qf_title.in
test_eval.out: test_eval.in
test_options.out: test_options.in
diff --git a/src/testdir/Make_dos.mak b/src/testdir/Make_dos.mak
index d715d0776..86176ae48 100644
--- a/src/testdir/Make_dos.mak
+++ b/src/testdir/Make_dos.mak
@@ -39,6 +39,7 @@ SCRIPTS = test3.out test4.out test5.out test6.out test7.out \
test_breakindent.out \
test_listlbr.out \
test_listlbr_utf8.out \
+ test_qf_title.out \
test_eval.out \
test_options.out
diff --git a/src/testdir/Make_ming.mak b/src/testdir/Make_ming.mak
index 899351769..cf10301b2 100644
--- a/src/testdir/Make_ming.mak
+++ b/src/testdir/Make_ming.mak
@@ -59,6 +59,7 @@ SCRIPTS = test3.out test4.out test5.out test6.out test7.out \
test_breakindent.out \
test_listlbr.out \
test_listlbr_utf8.out \
+ test_qf_title.out \
test_eval.out \
test_options.out
diff --git a/src/testdir/Make_os2.mak b/src/testdir/Make_os2.mak
index b37bf2aae..a7f3989f8 100644
--- a/src/testdir/Make_os2.mak
+++ b/src/testdir/Make_os2.mak
@@ -40,8 +40,9 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
test_autoformat_join.out \
test_eval.out \
test_breakindent.out \
- test_listlbr_utf8.out \
test_listlbr.out \
+ test_listlbr_utf8.out \
+ test_qf_title.out \
test_options.out
.SUFFIXES: .in .out
diff --git a/src/testdir/Make_vms.mms b/src/testdir/Make_vms.mms
index 9c6f1189a..9bf395be3 100644
--- a/src/testdir/Make_vms.mms
+++ b/src/testdir/Make_vms.mms
@@ -4,7 +4,7 @@
# Authors: Zoltan Arpadffy, <arpadffy@polarhome.com>
# Sandor Kopanyi, <sandor.kopanyi@mailbox.hu>
#
-# Last change: 2014 May 28
+# Last change: 2014 Jul 23
#
# This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64.
# Edit the lines in the Configuration section below to select.
@@ -100,6 +100,7 @@ SCRIPT = test1.out test2.out test3.out test4.out test5.out \
test_breakindent.out \
test_listlbr.out \
test_listlbr_utf8.out \
+ test_qf_title.out \
test_eval.out \
test_options.out
diff --git a/src/testdir/Makefile b/src/testdir/Makefile
index abfef353b..b5f5d1803 100644
--- a/src/testdir/Makefile
+++ b/src/testdir/Makefile
@@ -37,6 +37,7 @@ SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \
test_breakindent.out \
test_listlbr.out \
test_listlbr_utf8.out \
+ test_qf_title.out \
test_eval.out \
test_options.out
diff --git a/src/testdir/test_qf_title.in b/src/testdir/test_qf_title.in
new file mode 100644
index 000000000..fce0c260e
--- /dev/null
+++ b/src/testdir/test_qf_title.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 test_qf_title:
diff --git a/src/testdir/test_qf_title.ok b/src/testdir/test_qf_title.ok
new file mode 100644
index 000000000..4ebdbeff3
--- /dev/null
+++ b/src/testdir/test_qf_title.ok
@@ -0,0 +1,2 @@
+Results of test_qf_title:
+:setqflist()
diff --git a/src/version.c b/src/version.c
index c0b0c3581..c312e99dd 100644
--- a/src/version.c
+++ b/src/version.c
@@ -735,6 +735,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 378,
+/**/
377,
/**/
376,