To: vim_dev@googlegroups.com Subject: Patch 7.4.1671 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 7.4.1671 Problem: When help exists in multiple languages, adding @ab while "ab" is the default help language is unnecessary. Solution: Leave out "@ab" when not needed. (Ken Takata) Files: src/ex_getln.c *** ../vim-7.4.1670/src/ex_getln.c 2016-03-22 20:31:10.122539696 +0100 --- src/ex_getln.c 2016-03-28 19:47:40.058665193 +0200 *************** *** 4491,4497 **** #ifdef FEAT_MULTI_LANG /* ! * Cleanup matches for help tags: remove "@en" if "en" is the only language. */ static void cleanup_help_tags(int num_file, char_u **file); --- 4491,4499 ---- #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); *************** *** 4500,4510 **** { int i, j; int len; for (i = 0; i < num_file; ++i) { len = (int)STRLEN(file[i]) - 3; ! if (len > 0 && 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". */ --- 4502,4529 ---- { int i, j; int len; + char_u buf[4]; + char_u *p = buf; + + if (p_hlg[0] != NUL) + { + *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 (i == 0 && STRCMP(file[i] + len, buf) == 0) ! { ! file[i][len] = NUL; ! break; ! } ! else 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". */ *************** *** 4514,4520 **** --- 4533,4542 ---- && STRNCMP(file[i], file[j], len + 1) == 0) break; if (j == num_file) + { file[i][len] = NUL; + break; + } } } } *** ../vim-7.4.1670/src/version.c 2016-03-28 19:27:09.951194772 +0200 --- src/version.c 2016-03-28 19:40:59.086753470 +0200 *************** *** 750,751 **** --- 750,753 ---- { /* Add new patch number below this line */ + /**/ + 1671, /**/ -- hundred-and-one symptoms of being an internet addict: 150. You find yourself counting emoticons to get to sleep. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///