aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/quickfix.c
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-05-20 18:05:39 -0400
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-05-21 20:04:38 -0400
commit83e48174e61dcda681bfece3220582b7f557ae60 (patch)
tree0185730b3111946443e19b15acf88231fd31065e /src/nvim/quickfix.c
parent6dd04ed5f6c0b68eed38aeb2a3f930d8d6353678 (diff)
downloadrneovim-83e48174e61dcda681bfece3220582b7f557ae60.tar.gz
rneovim-83e48174e61dcda681bfece3220582b7f557ae60.tar.bz2
rneovim-83e48174e61dcda681bfece3220582b7f557ae60.zip
vim-patch:8.1.2320: insufficient test coverage for quickfix
Problem: Insufficient test coverage for quickfix. Solution: Add more tests. Fix uncovered problem. (Yegappan Lakshmanan, closes vim/vim#5238) https://github.com/vim/vim/commit/f9ae154c512683ea7b933f870b0268232fd7ad38
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;
}
}