Patch 8.2.2147
Problem: Quickfix window title not updated in all tab pages.
Solution: Update the quickfix window title in all tab pages. (Yegappan
Lakshmanan, closes #7481, closes #7466)
Files: src/quickfix.c, src/testdir/test_quickfix.vim
*** ../vim-8.2.2146/src/quickfix.c 2020-11-29 14:20:23.677476671 +0100
--- src/quickfix.c 2020-12-16 20:58:50.051718218 +0100
***************
*** 4431,4451 ****
}
/*
! * Update the w:quickfix_title variable in the quickfix/location list window
*/
static void
qf_update_win_titlevar(qf_info_T *qi)
{
win_T *win;
! win_T *curwin_save;
! if ((win = qf_find_win(qi)) != NULL)
{
! curwin_save = curwin;
! curwin = win;
! qf_set_title_var(qf_get_curlist(qi));
! curwin = curwin_save;
}
}
/*
--- 4431,4456 ----
}
/*
! * Update the w:quickfix_title variable in the quickfix/location list window in
! * all the tab pages.
*/
static void
qf_update_win_titlevar(qf_info_T *qi)
{
+ qf_list_T *qfl = qf_get_curlist(qi);
+ tabpage_T *tp;
win_T *win;
! win_T *save_curwin = curwin;
! FOR_ALL_TAB_WINDOWS(tp, win)
{
! if (is_qf_win(win, qi))
! {
! curwin = win;
! qf_set_title_var(qfl);
! }
}
+ curwin = save_curwin;
}
/*
*** ../vim-8.2.2146/src/testdir/test_quickfix.vim 2020-12-05 13:40:57.499035073 +0100
--- src/testdir/test_quickfix.vim 2020-12-16 20:58:50.055718206 +0100
***************
*** 4165,4170 ****
--- 4165,4194 ----
call setqflist([], 'r', {'items' : [{'filename' : 'a.c', 'lnum' : 10}]})
call assert_equal('Errors', w:quickfix_title)
cclose
+
+ " Switching to another quickfix list in one tab page should update the
+ " quickfix window title and statusline in all the other tab pages also
+ call setqflist([], 'f')
+ %bw!
+ cgetexpr ['file_one:1:1: error in the first quickfix list']
+ call setqflist([], 'a', {'title': 'first quickfix list'})
+ cgetexpr ['file_two:2:1: error in the second quickfix list']
+ call setqflist([], 'a', {'title': 'second quickfix list'})
+ copen
+ wincmd t
+ tabnew two
+ copen
+ wincmd t
+ colder
+ call assert_equal('first quickfix list', gettabwinvar(1, 2, 'quickfix_title'))
+ call assert_equal('first quickfix list', gettabwinvar(2, 2, 'quickfix_title'))
+ call assert_equal(1, tabpagewinnr(1))
+ call assert_equal(1, tabpagewinnr(2))
+ tabnew
+ call setqflist([], 'a', {'title': 'new quickfix title'})
+ call assert_equal('new quickfix title', gettabwinvar(1, 2, 'quickfix_title'))
+ call assert_equal('new quickfix title', gettabwinvar(2, 2, 'quickfix_title'))
+ %bw!
endfunc
func Test_lbuffer_with_bwipe()
*** ../vim-8.2.2146/src/version.c 2020-12-15 21:41:53.145431360 +0100
--- src/version.c 2020-12-16 21:02:32.634995396 +0100
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 2147,
/**/
--
If you don't get everything you want, think of
everything you didn't get and don't want.
/// Bram Moolenaar -- Br...@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 ///