aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/quickfix.c
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-05-22 10:12:42 -0400
committerGitHub <noreply@github.com>2021-05-22 10:12:42 -0400
commit449bbf5540886a9b892b551162080e2dc9a37990 (patch)
treef600e2fa5888e5273aa6a7ef69e09cf407a1755f /src/nvim/quickfix.c
parent6dd04ed5f6c0b68eed38aeb2a3f930d8d6353678 (diff)
parent486050ebc94d125b6a30340ec595ef62956624a7 (diff)
downloadrneovim-449bbf5540886a9b892b551162080e2dc9a37990.tar.gz
rneovim-449bbf5540886a9b892b551162080e2dc9a37990.tar.bz2
rneovim-449bbf5540886a9b892b551162080e2dc9a37990.zip
Merge pull request #14601 from janlazo/vim-8.1.2320
vim-patch:8.1.{2320,2339},8.2.{946,1591,2875}
Diffstat (limited to 'src/nvim/quickfix.c')
-rw-r--r--src/nvim/quickfix.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c
index ac27e92932..1a9bbe26f0 100644
--- a/src/nvim/quickfix.c
+++ b/src/nvim/quickfix.c
@@ -2672,7 +2672,7 @@ static void qf_goto_win_with_qfl_file(int qf_fnum)
static int qf_jump_to_usable_window(int qf_fnum, bool newwin,
int *opened_window)
{
- win_T *usable_win_ptr = NULL;
+ win_T *usable_wp = NULL;
bool usable_win = false;
// If opening a new window, then don't use the location list referred by
@@ -2681,8 +2681,8 @@ static int qf_jump_to_usable_window(int qf_fnum, bool newwin,
qf_info_T *ll_ref = newwin ? NULL : curwin->w_llist_ref;
if (ll_ref != NULL) {
// Find a non-quickfix window with this location list
- usable_win_ptr = qf_find_win_with_loclist(ll_ref);
- if (usable_win_ptr != NULL) {
+ usable_wp = qf_find_win_with_loclist(ll_ref);
+ if (usable_wp != NULL) {
usable_win = true;
}
}
@@ -2710,7 +2710,7 @@ static int qf_jump_to_usable_window(int qf_fnum, bool newwin,
*opened_window = true; // close it when fail
} else {
if (curwin->w_llist_ref != NULL) { // In a location window
- qf_goto_win_with_ll_file(usable_win_ptr, qf_fnum, ll_ref);
+ qf_goto_win_with_ll_file(usable_wp, qf_fnum, ll_ref);
} else { // In a quickfix window
qf_goto_win_with_qfl_file(qf_fnum);
}
@@ -3038,14 +3038,11 @@ theend:
qfl->qf_ptr = qf_ptr;
qfl->qf_index = qf_index;
}
- if (p_swb != old_swb && opened_window) {
+ if (p_swb != old_swb && p_swb == empty_option && opened_window) {
// Restore old 'switchbuf' value, but not when an autocommand or
// modeline has changed the value.
- if (p_swb == empty_option) {
- p_swb = old_swb;
- swb_flags = old_swb_flags;
- } else
- free_string_option(old_swb);
+ p_swb = old_swb;
+ swb_flags = old_swb_flags;
}
}