1
0
forked from aniani/vim

patch 7.4.718

Problem:    Autocommands triggered by quickfix cannot get the current title
            value.
Solution:   Set w:quickfix_title earlier. (Yannick)
            Also move the check for a title into the function.
This commit is contained in:
Bram Moolenaar
2015-05-04 12:34:22 +02:00
parent 1cd5e613b0
commit 81278efadf
2 changed files with 10 additions and 6 deletions

View File

@@ -2452,14 +2452,13 @@ ex_copen(eap)
prevwin = win; prevwin = win;
} }
qf_set_title_var(qi);
/* /*
* Fill the buffer with the quickfix list. * Fill the buffer with the quickfix list.
*/ */
qf_fill_buffer(qi); qf_fill_buffer(qi);
if (qi->qf_lists[qi->qf_curlist].qf_title != NULL)
qf_set_title_var(qi);
curwin->w_cursor.lnum = qi->qf_lists[qi->qf_curlist].qf_index; curwin->w_cursor.lnum = qi->qf_lists[qi->qf_curlist].qf_index;
curwin->w_cursor.col = 0; curwin->w_cursor.col = 0;
check_cursor(); check_cursor();
@@ -2608,8 +2607,7 @@ qf_update_buffer(qi)
qf_fill_buffer(qi); qf_fill_buffer(qi);
if (qi->qf_lists[qi->qf_curlist].qf_title != NULL if ((win = qf_find_win(qi)) != NULL)
&& (win = qf_find_win(qi)) != NULL)
{ {
curwin_save = curwin; curwin_save = curwin;
curwin = win; curwin = win;
@@ -2625,11 +2623,15 @@ qf_update_buffer(qi)
} }
} }
/*
* Set "w:quickfix_title" if "qi" has a title.
*/
static void static void
qf_set_title_var(qi) qf_set_title_var(qi)
qf_info_T *qi; qf_info_T *qi;
{ {
set_internal_string_var((char_u *)"w:quickfix_title", if (qi->qf_lists[qi->qf_curlist].qf_title != NULL)
set_internal_string_var((char_u *)"w:quickfix_title",
qi->qf_lists[qi->qf_curlist].qf_title); qi->qf_lists[qi->qf_curlist].qf_title);
} }

View File

@@ -741,6 +741,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
718,
/**/ /**/
717, 717,
/**/ /**/