Hi Bram!
On Mo, 04 Mai 2015, Bram Moolenaar wrote:
>
> 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.
> Files: src/quickfix.c
The same problem occurs in qf_update_buffer() later on as noticed by the neovim
guys.
Attached patch fixes it (and tests for it).
Best,
Christian
--
"Vis superba formae." Ein schönes Wort von Johannes Secundus.
-- Goethe, Maximen und Reflektionen, Nr. 498
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.
commit 58a07ec1567c4045b13b4990dce96026cb334971
Author: Christian Brabandt <[email protected]>
Date: Fri Jan 22 12:57:11 2016 +0100
set quickfix title earlier
diff --git a/src/quickfix.c b/src/quickfix.c
index 014b93d..da405ed 100644
--- a/src/quickfix.c
+++ b/src/quickfix.c
@@ -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);
diff --git a/src/testdir/test_quickfix.vim b/src/testdir/test_quickfix.vim
index a4d0f20..5e68450 100644
--- a/src/testdir/test_quickfix.vim
+++ b/src/testdir/test_quickfix.vim
@@ -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