Mercurial > vim
comparison src/quickfix.c @ 27938:b65a50d2fa4f v8.2.4494
patch 8.2.4494: the find_tags() function is much too long
Commit: https://github.com/vim/vim/commit/2f87a99b6e9b559d51e130769e7f8377db6749f8
Author: Yegappan Lakshmanan <yegappan@yahoo.com>
Date: Wed Mar 2 20:29:35 2022 +0000
patch 8.2.4494: the find_tags() function is much too long
Problem: The find_tags() function is much too long.
Solution: Refactor the function. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/9869)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 02 Mar 2022 21:30:03 +0100 |
parents | 2a2c0958a913 |
children | 495418c6cac8 |
comparison
equal
deleted
inserted
replaced
27937:2550ae69df4f | 27938:b65a50d2fa4f |
---|---|
5011 win_T *wp = NULL; | 5011 win_T *wp = NULL; |
5012 qf_info_T *qi = &ql_info; | 5012 qf_info_T *qi = &ql_info; |
5013 int res; | 5013 int res; |
5014 char_u *au_name = NULL; | 5014 char_u *au_name = NULL; |
5015 int_u save_qfid; | 5015 int_u save_qfid; |
5016 char_u *errorformat = p_efm; | |
5017 int newlist = TRUE; | |
5016 | 5018 |
5017 // Redirect ":grep" to ":vimgrep" if 'grepprg' is "internal". | 5019 // Redirect ":grep" to ":vimgrep" if 'grepprg' is "internal". |
5018 if (grep_internal(eap->cmdidx)) | 5020 if (grep_internal(eap->cmdidx)) |
5019 { | 5021 { |
5020 ex_vimgrep(eap); | 5022 ex_vimgrep(eap); |
5057 (void)char_avail(); | 5059 (void)char_avail(); |
5058 #endif | 5060 #endif |
5059 | 5061 |
5060 incr_quickfix_busy(); | 5062 incr_quickfix_busy(); |
5061 | 5063 |
5062 res = qf_init(wp, fname, (eap->cmdidx != CMD_make | 5064 if (eap->cmdidx != CMD_make && eap->cmdidx != CMD_lmake) |
5063 && eap->cmdidx != CMD_lmake) ? p_gefm : p_efm, | 5065 errorformat = p_gefm; |
5064 (eap->cmdidx != CMD_grepadd | 5066 if (eap->cmdidx == CMD_grepadd || eap->cmdidx == CMD_lgrepadd) |
5065 && eap->cmdidx != CMD_lgrepadd), | 5067 newlist = FALSE; |
5066 qf_cmdtitle(*eap->cmdlinep), enc); | 5068 |
5069 res = qf_init(wp, fname, errorformat, newlist, qf_cmdtitle(*eap->cmdlinep), | |
5070 enc); | |
5067 if (wp != NULL) | 5071 if (wp != NULL) |
5068 { | 5072 { |
5069 qi = GET_LOC_LIST(wp); | 5073 qi = GET_LOC_LIST(wp); |
5070 if (qi == NULL) | 5074 if (qi == NULL) |
5071 goto cleanup; | 5075 goto cleanup; |