mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
patch 7.4.1820
Problem: Removing language from help tags too often. Solution: Only remove @en when not needed. (Hirohito Higashi)
This commit is contained in:
@@ -4519,25 +4519,32 @@ cleanup_help_tags(int num_file, char_u **file)
|
||||
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;
|
||||
}
|
||||
else if (STRCMP(file[i] + len, "@en") == 0)
|
||||
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)
|
||||
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
|
||||
|
||||
|
Reference in New Issue
Block a user