aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Ennen <mike.ennen@gmail.com>2016-01-13 17:18:19 -0700
committerMichael Ennen <mike.ennen@gmail.com>2016-01-22 12:52:01 -0700
commit8048699f7d2f66a6df4c76607a150545820fcb7a (patch)
tree503aaa197206c9da2b65dd5c88b723563212ba3b /src
parent573d65c738dd2e5f4ee92a7f20946411206021f7 (diff)
downloadrneovim-8048699f7d2f66a6df4c76607a150545820fcb7a.tar.gz
rneovim-8048699f7d2f66a6df4c76607a150545820fcb7a.tar.bz2
rneovim-8048699f7d2f66a6df4c76607a150545820fcb7a.zip
vim-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. https://github.com/vim/vim/commit/81278efadf45ad745ec9733fdd9970f070571544
Diffstat (limited to 'src')
-rw-r--r--src/nvim/quickfix.c24
-rw-r--r--src/nvim/version.c2
2 files changed, 11 insertions, 15 deletions
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c
index 3abf43cb8c..85c69af192 100644
--- a/src/nvim/quickfix.c
+++ b/src/nvim/quickfix.c
@@ -2117,14 +2117,10 @@ void ex_copen(exarg_T *eap)
prevwin = win;
}
- /*
- * Fill the buffer with the quickfix list.
- */
- qf_fill_buffer(qi);
+ qf_set_title_var(qi);
- if (qi->qf_lists[qi->qf_curlist].qf_title != NULL) {
- qf_set_title_var(qi);
- }
+ // Fill the buffer with the quickfix list.
+ qf_fill_buffer(qi);
curwin->w_cursor.lnum = qi->qf_lists[qi->qf_curlist].qf_index;
curwin->w_cursor.col = 0;
@@ -2256,16 +2252,13 @@ static void qf_update_buffer(qf_info_T *qi)
/* set curwin/curbuf to buf and save a few things */
aucmd_prepbuf(&aco, buf);
- qf_fill_buffer(qi);
-
- if (qi->qf_lists[qi->qf_curlist].qf_title != NULL
- && (win = qf_find_win(qi)) != NULL) {
+ 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);
@@ -2274,10 +2267,13 @@ static void qf_update_buffer(qf_info_T *qi)
}
}
+// Set "w:quickfix_title" if "qi" has a title.
static void qf_set_title_var(qf_info_T *qi)
{
- set_internal_string_var((char_u *)"w:quickfix_title",
- qi->qf_lists[qi->qf_curlist].qf_title);
+ if (qi->qf_lists[qi->qf_curlist].qf_title != NULL) {
+ set_internal_string_var((char_u *)"w:quickfix_title",
+ qi->qf_lists[qi->qf_curlist].qf_title);
+ }
}
/*
diff --git a/src/nvim/version.c b/src/nvim/version.c
index 804f750e18..53a877b91a 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -406,7 +406,7 @@ static int included_patches[] = {
// 721,
// 720 NA
719,
- // 718,
+ 718,
// 717,
// 716,
// 715,