0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

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 #9869)
This commit is contained in:
Yegappan Lakshmanan
2022-03-02 20:29:35 +00:00
committed by Bram Moolenaar
parent b9c5108593
commit 2f87a99b6e
4 changed files with 1219 additions and 1106 deletions

View File

@@ -5013,6 +5013,8 @@ ex_make(exarg_T *eap)
int res; int res;
char_u *au_name = NULL; char_u *au_name = NULL;
int_u save_qfid; int_u save_qfid;
char_u *errorformat = p_efm;
int newlist = TRUE;
// Redirect ":grep" to ":vimgrep" if 'grepprg' is "internal". // Redirect ":grep" to ":vimgrep" if 'grepprg' is "internal".
if (grep_internal(eap->cmdidx)) if (grep_internal(eap->cmdidx))
@@ -5059,11 +5061,13 @@ ex_make(exarg_T *eap)
incr_quickfix_busy(); incr_quickfix_busy();
res = qf_init(wp, fname, (eap->cmdidx != CMD_make if (eap->cmdidx != CMD_make && eap->cmdidx != CMD_lmake)
&& eap->cmdidx != CMD_lmake) ? p_gefm : p_efm, errorformat = p_gefm;
(eap->cmdidx != CMD_grepadd if (eap->cmdidx == CMD_grepadd || eap->cmdidx == CMD_lgrepadd)
&& eap->cmdidx != CMD_lgrepadd), newlist = FALSE;
qf_cmdtitle(*eap->cmdlinep), enc);
res = qf_init(wp, fname, errorformat, newlist, qf_cmdtitle(*eap->cmdlinep),
enc);
if (wp != NULL) if (wp != NULL)
{ {
qi = GET_LOC_LIST(wp); qi = GET_LOC_LIST(wp);

842
src/tag.c

File diff suppressed because it is too large Load Diff

View File

@@ -1427,6 +1427,11 @@ func Test_tagfile_errors()
endtry endtry
call assert_equal(v:true, caught_431) 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('Xtags')
call delete('Xfile') call delete('Xfile')
set tags& set tags&

View File

@@ -754,6 +754,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
4494,
/**/ /**/
4493, 4493,
/**/ /**/