comparison src/quickfix.c @ 27873:d1af65b322d0 v8.2.4462

patch 8.2.4462: not enough testing for quickfix code Commit: https://github.com/vim/vim/commit/9c9be05b17ececb1515a2f41a4dedbf848d3d8b6 Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Thu Feb 24 12:33:17 2022 +0000 patch 8.2.4462: not enough testing for quickfix code Problem: Not enough testing for quickfix code. Solution: Add more tests. Fix uncovered problem. (Yegappan Lakshmanan, closes #9839)
author Bram Moolenaar <Bram@vim.org>
date Thu, 24 Feb 2022 13:45:03 +0100
parents 44a552776007
children 2a2c0958a913
comparison
equal deleted inserted replaced
27872:7f09baac337b 27873:d1af65b322d0
2084 } 2084 }
2085 #endif 2085 #endif
2086 2086
2087 /* 2087 /*
2088 * Add an entry to the end of the list of errors. 2088 * Add an entry to the end of the list of errors.
2089 * Returns QF_OK or QF_FAIL. 2089 * Returns QF_OK on success or QF_FAIL on a memory allocation failure.
2090 */ 2090 */
2091 static int 2091 static int
2092 qf_add_entry( 2092 qf_add_entry(
2093 qf_list_T *qfl, // quickfix list entry 2093 qf_list_T *qfl, // quickfix list entry
2094 char_u *dir, // optional directory name 2094 char_u *dir, // optional directory name
4049 void 4049 void
4050 qf_view_result(int split) 4050 qf_view_result(int split)
4051 { 4051 {
4052 qf_info_T *qi = &ql_info; 4052 qf_info_T *qi = &ql_info;
4053 4053
4054 if (!bt_quickfix(curbuf))
4055 return;
4056
4057 if (IS_LL_WINDOW(curwin)) 4054 if (IS_LL_WINDOW(curwin))
4058 qi = GET_LOC_LIST(curwin); 4055 qi = GET_LOC_LIST(curwin);
4059 4056
4060 if (qf_list_empty(qf_get_curlist(qi))) 4057 if (qf_list_empty(qf_get_curlist(qi)))
4061 { 4058 {
4523 { 4520 {
4524 if (curwin->w_llist == qi) 4521 if (curwin->w_llist == qi)
4525 win = curwin; 4522 win = curwin;
4526 else 4523 else
4527 { 4524 {
4525 // Find the file window (non-quickfix) with this location list
4528 win = qf_find_win_with_loclist(qi); 4526 win = qf_find_win_with_loclist(qi);
4527 if (win == NULL)
4528 // File window is not found. Find the location list window.
4529 win = qf_find_win(qi);
4529 if (win == NULL) 4530 if (win == NULL)
4530 return; 4531 return;
4531 } 4532 }
4532 qf_winid = win->w_id; 4533 qf_winid = win->w_id;
4533 } 4534 }
8341 if (!bt_help(curwin->w_buffer) || curwin->w_llist == qi) 8342 if (!bt_help(curwin->w_buffer) || curwin->w_llist == qi)
8342 { 8343 {
8343 if (new_qi) 8344 if (new_qi)
8344 ll_free_all(&qi); 8345 ll_free_all(&qi);
8345 } 8346 }
8346 else if (curwin->w_llist == NULL) 8347 else if (curwin->w_llist == NULL && new_qi)
8348 // current window didn't have a location list associated with it
8349 // before. Associate the new location list now.
8347 curwin->w_llist = qi; 8350 curwin->w_llist = qi;
8348 } 8351 }
8349 } 8352 }
8350 #endif // FEAT_QUICKFIX 8353 #endif // FEAT_QUICKFIX
8351 8354