]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.2.2147: quickfix window title not updated in all tab pages v8.2.2147
authorBram Moolenaar <Bram@vim.org>
Wed, 16 Dec 2020 20:02:56 +0000 (21:02 +0100)
committerBram Moolenaar <Bram@vim.org>
Wed, 16 Dec 2020 20:02:56 +0000 (21:02 +0100)
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)

src/quickfix.c
src/testdir/test_quickfix.vim
src/version.c

index d7a163dfff4cefb3cdcd10ebd66df23c05e693e5..89ca2d31eb9d4789f19efa5344b63c4ca08af0c1 100644 (file)
@@ -4431,21 +4431,26 @@ qf_process_qftf_option(void)
 }
 
 /*
- * Update the w:quickfix_title variable in the quickfix/location list window
+ * 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      *curwin_save;
+    win_T      *save_curwin = curwin;
 
-    if ((win = qf_find_win(qi)) != NULL)
+    FOR_ALL_TAB_WINDOWS(tp, win)
     {
-       curwin_save = curwin;
-       curwin = win;
-       qf_set_title_var(qf_get_curlist(qi));
-       curwin = curwin_save;
+       if (is_qf_win(win, qi))
+       {
+           curwin = win;
+           qf_set_title_var(qfl);
+       }
     }
+    curwin = save_curwin;
 }
 
 /*
index d89508f06af54e85ec87e90b56458057bf95180a..888c2f4bf9990c5873c3b012b22682e25c8737ba 100644 (file)
@@ -4165,6 +4165,30 @@ func Test_qftitle()
   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()
index a95042c15c86eccfda6fa0cceebc6b2eb339f3c0..f28bb4a43a16ba569b14c7de703ff5909f0e2769 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2147,
 /**/
     2146,
 /**/