Skip to content

Commit 530bed9

Browse files
committed
patch 8.2.2147: quickfix window title not updated in all tab pages
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)
1 parent 9987fb0 commit 530bed9

3 files changed

Lines changed: 38 additions & 7 deletions

File tree

src/quickfix.c

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4431,21 +4431,26 @@ qf_process_qftf_option(void)
44314431
}
44324432

44334433
/*
4434-
* Update the w:quickfix_title variable in the quickfix/location list window
4434+
* Update the w:quickfix_title variable in the quickfix/location list window in
4435+
* all the tab pages.
44354436
*/
44364437
static void
44374438
qf_update_win_titlevar(qf_info_T *qi)
44384439
{
4440+
qf_list_T *qfl = qf_get_curlist(qi);
4441+
tabpage_T *tp;
44394442
win_T *win;
4440-
win_T *curwin_save;
4443+
win_T *save_curwin = curwin;
44414444

4442-
if ((win = qf_find_win(qi)) != NULL)
4445+
FOR_ALL_TAB_WINDOWS(tp, win)
44434446
{
4444-
curwin_save = curwin;
4445-
curwin = win;
4446-
qf_set_title_var(qf_get_curlist(qi));
4447-
curwin = curwin_save;
4447+
if (is_qf_win(win, qi))
4448+
{
4449+
curwin = win;
4450+
qf_set_title_var(qfl);
4451+
}
44484452
}
4453+
curwin = save_curwin;
44494454
}
44504455

44514456
/*

src/testdir/test_quickfix.vim

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4165,6 +4165,30 @@ func Test_qftitle()
41654165
call setqflist([], 'r', {'items' : [{'filename' : 'a.c', 'lnum' : 10}]})
41664166
call assert_equal('Errors', w:quickfix_title)
41674167
cclose
4168+
4169+
" Switching to another quickfix list in one tab page should update the
4170+
" quickfix window title and statusline in all the other tab pages also
4171+
call setqflist([], 'f')
4172+
%bw!
4173+
cgetexpr ['file_one:1:1: error in the first quickfix list']
4174+
call setqflist([], 'a', {'title': 'first quickfix list'})
4175+
cgetexpr ['file_two:2:1: error in the second quickfix list']
4176+
call setqflist([], 'a', {'title': 'second quickfix list'})
4177+
copen
4178+
wincmd t
4179+
tabnew two
4180+
copen
4181+
wincmd t
4182+
colder
4183+
call assert_equal('first quickfix list', gettabwinvar(1, 2, 'quickfix_title'))
4184+
call assert_equal('first quickfix list', gettabwinvar(2, 2, 'quickfix_title'))
4185+
call assert_equal(1, tabpagewinnr(1))
4186+
call assert_equal(1, tabpagewinnr(2))
4187+
tabnew
4188+
call setqflist([], 'a', {'title': 'new quickfix title'})
4189+
call assert_equal('new quickfix title', gettabwinvar(1, 2, 'quickfix_title'))
4190+
call assert_equal('new quickfix title', gettabwinvar(2, 2, 'quickfix_title'))
4191+
%bw!
41684192
endfunc
41694193

41704194
func Test_lbuffer_with_bwipe()

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,8 @@ static char *(features[]) =
750750

751751
static int included_patches[] =
752752
{ /* Add new patch number below this line */
753+
/**/
754+
2147,
753755
/**/
754756
2146,
755757
/**/

0 commit comments

Comments
 (0)