On Di, 18 Feb 2014, Christian Brabandt wrote:
> diff --git a/src/quickfix.c b/src/quickfix.c
[...]
looks like the patch was a little bit mumbled by the mail, so here it is
attached.
Best,
Christian
--
<|Rain|> #define struct union /* great space saver */
--
--
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/groups/opt_out.
diff --git a/src/quickfix.c b/src/quickfix.c
--- a/src/quickfix.c
+++ b/src/quickfix.c
@@ -1464,6 +1464,9 @@
#endif
int ok = OK;
int usable_win;
+#ifdef FEAT_AUTOCMD
+ char_u *save_ei = NULL;
+#endif
if (qi == NULL)
qi = &ql_info;
@@ -1782,6 +1785,13 @@
*/
old_curbuf = curbuf;
old_lnum = curwin->w_cursor.lnum;
+#ifdef FEAT_AUTOCMD
+ save_ei = vim_strsave(p_ei);
+ /* postpone triggering of BufWinEnter autocommand until the cursor is
+ * positioned at the correct location */
+ set_string_option_direct((char_u *)"ei", -1, (char_u *)"BufWinEnter",
+ OPT_FREE, SID_NONE);
+#endif
if (qf_ptr->qf_fnum != 0)
{
@@ -1931,6 +1941,15 @@
free_string_option(old_swb);
}
#endif
+#ifdef FEAT_AUTOCMD
+ if (save_ei != NULL)
+ {
+ set_string_option_direct((char_u *)"ei", -1, save_ei, OPT_FREE, SID_NONE);
+ free_string_option(save_ei);
+ if (ok == OK && curbuf != old_curbuf)
+ apply_autocmds(EVENT_BUFWINENTER, NULL, NULL, FALSE, curbuf);
+ }
+#endif
}
/*