vim-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 vim/vim#9869)

2f87a99b6e

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
This commit is contained in:
zeertzjq 2022-11-18 13:25:21 +08:00
parent 282cbc2350
commit 245035d6db
3 changed files with 804 additions and 743 deletions

View File

@ -4308,10 +4308,17 @@ void ex_make(exarg_T *eap)
incr_quickfix_busy();
int res = qf_init(wp, fname, (eap->cmdidx != CMD_make
&& eap->cmdidx != CMD_lmake) ? p_gefm : p_efm,
(eap->cmdidx != CMD_grepadd && eap->cmdidx != CMD_lgrepadd),
qf_cmdtitle(*eap->cmdlinep), enc);
char *errorformat = p_efm;
bool newlist = true;
if (eap->cmdidx != CMD_make && eap->cmdidx != CMD_lmake) {
errorformat = p_gefm;
}
if (eap->cmdidx == CMD_grepadd || eap->cmdidx == CMD_lgrepadd) {
newlist = false;
}
int res = qf_init(wp, fname, errorformat, newlist, qf_cmdtitle(*eap->cmdlinep), enc);
qf_info_T *qi = &ql_info;
if (wp != NULL) {

File diff suppressed because it is too large Load Diff

View File

@ -1448,6 +1448,11 @@ func Test_tagfile_errors()
endtry
call assert_equal(v:true, caught_431)
" tag name and file name are not separated by a tab
call writefile(["!_TAG_FILE_ENCODING\tutf-8\t//",
\ "foo Xfile 1"], 'Xtags')
call assert_fails('tag foo', 'E431:')
call delete('Xtags')
call delete('Xfile')
set tags&