diff options
Diffstat (limited to 'src/nvim/ex_getln.c')
-rw-r--r-- | src/nvim/ex_getln.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index b098f7d4ee..4c997844ea 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -3688,10 +3688,7 @@ static void cleanup_help_tags(int num_file, char_u **file) 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". int j; @@ -3708,6 +3705,19 @@ static void cleanup_help_tags(int num_file, char_u **file) } } } + + if (*buf != NUL) { + for (int i = 0; i < num_file; i++) { + int 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; + } + } + } } /* |