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

patch 8.2.1262: src/ex_cmds.c file is too big

Problem:    src/ex_cmds.c file is too big.
Solution:   Move help related code to src/help.c. (Yegappan Lakshmanan,
            closes #6506)
This commit is contained in:
Bram Moolenaar
2020-07-21 21:07:20 +02:00
parent c7db57788b
commit f868ba8903
14 changed files with 1344 additions and 1346 deletions

View File

@@ -1887,62 +1887,6 @@ expand_cmdline(
return EXPAND_OK;
}
#ifdef FEAT_MULTI_LANG
/*
* Cleanup matches for help tags:
* Remove "@ab" if the top of 'helplang' is "ab" and the language of the first
* tag matches it. Otherwise remove "@en" if "en" is the only language.
*/
static void
cleanup_help_tags(int num_file, char_u **file)
{
int i, j;
int len;
char_u buf[4];
char_u *p = buf;
if (p_hlg[0] != NUL && (p_hlg[0] != 'e' || p_hlg[1] != 'n'))
{
*p++ = '@';
*p++ = p_hlg[0];
*p++ = p_hlg[1];
}
*p = NUL;
for (i = 0; i < num_file; ++i)
{
len = (int)STRLEN(file[i]) - 3;
if (len <= 0)
continue;
if (STRCMP(file[i] + len, "@en") == 0)
{
// Sorting on priority means the same item in another language may
// be anywhere. Search all items for a match up to the "@en".
for (j = 0; j < num_file; ++j)
if (j != i && (int)STRLEN(file[j]) == len + 3
&& STRNCMP(file[i], file[j], len + 1) == 0)
break;
if (j == num_file)
// item only exists with @en, remove it
file[i][len] = NUL;
}
}
if (*buf != NUL)
for (i = 0; i < num_file; ++i)
{
len = (int)STRLEN(file[i]) - 3;
if (len <= 0)
continue;
if (STRCMP(file[i] + len, buf) == 0)
{
// remove the default language
file[i][len] = NUL;
}
}
}
#endif
/*
* Function given to ExpandGeneric() to obtain the possible arguments of the
* ":behave {mswin,xterm}" command.