diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-05-07 18:36:48 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-05-07 18:36:48 +0200 |
commit | 9ccaae04c6f263e6db14fc403bca2404a7871114 (patch) | |
tree | 030c467a8ebb3949d6723700caf46990ad8bc7ef /src/ex_getln.c | |
parent | 827b165b2aebad2cfe98cc6d5804c6c0fe8afd89 (diff) |
patch 7.4.1820v7.4.1820
Problem: Removing language from help tags too often.
Solution: Only remove @en when not needed. (Hirohito Higashi)
Diffstat (limited to 'src/ex_getln.c')
-rw-r--r-- | src/ex_getln.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/src/ex_getln.c b/src/ex_getln.c index 26fed59724..ed9707a262 100644 --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -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 |