patch 7.4.1153 v7.4.1153
authorBram Moolenaar <Bram@vim.org>
Fri, 22 Jan 2016 21:44:10 +0000 (22:44 +0100)
committerBram Moolenaar <Bram@vim.org>
Fri, 22 Jan 2016 21:44:10 +0000 (22:44 +0100)
Problem:    Autocommands triggered by quickfix cannot always get the current
            title value.
Solution:   Call qf_fill_buffer() later. (Christian Brabandt)

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

index 014b93df3452b5cd00b7ce8f9f75e576d45a72a7..da405ed58da6a305d9bb70a741a183c465362e23 100644 (file)
@@ -2605,17 +2605,16 @@ qf_update_buffer(qi)
        /* set curwin/curbuf to buf and save a few things */
        aucmd_prepbuf(&aco, buf);
 
-       qf_fill_buffer(qi);
-
        if ((win = qf_find_win(qi)) != NULL)
        {
            curwin_save = curwin;
            curwin = win;
            qf_set_title_var(qi);
            curwin = curwin_save;
-
        }
 
+       qf_fill_buffer(qi);
+
        /* restore curwin/curbuf and a few other things */
        aucmd_restbuf(&aco);
 
index a4d0f209e2482662c0bd61c36ff4e56a5aeeed79..5e684502395ae16895b2e9629552e11f39e988cf 100644 (file)
@@ -302,3 +302,17 @@ function Test_helpgrep()
   cclose
 endfunc
 
+func Test_errortitle()
+  augroup QfBufWinEnter
+    au!
+    au BufWinEnter * :let g:a=get(w:, 'quickfix_title', 'NONE')
+  augroup END
+  copen
+  let a=[{'lnum': 308, 'bufnr': bufnr(''), 'col': 58, 'valid': 1, 'vcol': 0, 'nr': 0, 'type': '', 'pattern': '', 'text': '    au BufWinEnter * :let g:a=get(w:, ''quickfix_title'', ''NONE'')'}]
+  call setqflist(a)
+  call assert_equal(':setqflist()', g:a)
+  augroup QfBufWinEnter
+    au!
+  augroup END
+  augroup! QfBufWinEnter
+endfunc
index 34cfad4dfea6144687eade1de10969e6f3a6e834..c964b3cad577a4033be4883ea61d0726f523fe54 100644 (file)
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1153,
 /**/
     1152,
 /**/