diff options
author | Jurica Bradaric <jbradaric@gmail.com> | 2016-09-25 21:40:37 +0200 |
---|---|---|
committer | Jurica Bradaric <jbradaric@gmail.com> | 2016-09-25 22:06:57 +0200 |
commit | 9114790c4ce73d7f2eae0a1a06a7ced02ab86cf0 (patch) | |
tree | 31a06288df51d15d12da655115659ea3800e1411 /src/nvim/ex_getln.c | |
parent | 641d4242904f4a9691bd7933beaf90f3cce81d97 (diff) | |
download | rneovim-9114790c4ce73d7f2eae0a1a06a7ced02ab86cf0.tar.gz rneovim-9114790c4ce73d7f2eae0a1a06a7ced02ab86cf0.tar.bz2 rneovim-9114790c4ce73d7f2eae0a1a06a7ced02ab86cf0.zip |
vim-patch:7.4.1820
Problem: Removing language from help tags too often.
Solution: Only remove @en when not needed. (Hirohito Higashi)
https://github.com/vim/vim/commit/9ccaae04c6f263e6db14fc403bca2404a7871114
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; + } + } + } } /* |