Mercurial > vim
comparison src/ex_getln.c @ 9066:c7bdd383275d v7.4.1818
commit https://github.com/vim/vim/commit/89c79b99328b66f77f1d12dc8c6701dfe2c57f15
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu May 5 17:18:41 2016 +0200
patch 7.4.1818
Problem: Help completion adds @en to all matches except the first one.
Solution: Remove "break", go over all items.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 05 May 2016 17:30:07 +0200 |
parents | 3daf70d22168 |
children | 0bb25b026fc9 |
comparison
equal
deleted
inserted
replaced
9065:3e45c2f5262b | 9066:c7bdd383275d |
---|---|
3187 ccline.cmdpos = from; | 3187 ccline.cmdpos = from; |
3188 } | 3188 } |
3189 #endif | 3189 #endif |
3190 | 3190 |
3191 /* | 3191 /* |
3192 * this function is called when the screen size changes and with incremental | 3192 * This function is called when the screen size changes and with incremental |
3193 * search | 3193 * search and in other situations where the command line may have been |
3194 * overwritten. | |
3194 */ | 3195 */ |
3195 void | 3196 void |
3196 redrawcmdline(void) | 3197 redrawcmdline(void) |
3197 { | 3198 { |
3198 if (cmd_silent) | 3199 if (cmd_silent) |
4503 int i, j; | 4504 int i, j; |
4504 int len; | 4505 int len; |
4505 char_u buf[4]; | 4506 char_u buf[4]; |
4506 char_u *p = buf; | 4507 char_u *p = buf; |
4507 | 4508 |
4508 if (p_hlg[0] != NUL) | 4509 if (p_hlg[0] != NUL && (p_hlg[0] != 'e' || p_hlg[1] != 'n')) |
4509 { | 4510 { |
4510 *p++ = '@'; | 4511 *p++ = '@'; |
4511 *p++ = p_hlg[0]; | 4512 *p++ = p_hlg[0]; |
4512 *p++ = p_hlg[1]; | 4513 *p++ = p_hlg[1]; |
4513 } | 4514 } |
4516 for (i = 0; i < num_file; ++i) | 4517 for (i = 0; i < num_file; ++i) |
4517 { | 4518 { |
4518 len = (int)STRLEN(file[i]) - 3; | 4519 len = (int)STRLEN(file[i]) - 3; |
4519 if (len <= 0) | 4520 if (len <= 0) |
4520 continue; | 4521 continue; |
4521 if (i == 0 && STRCMP(file[i] + len, buf) == 0) | 4522 if (STRCMP(file[i] + len, buf) == 0) |
4522 { | 4523 { |
4524 /* remove the default language */ | |
4523 file[i][len] = NUL; | 4525 file[i][len] = NUL; |
4524 break; | |
4525 } | 4526 } |
4526 else if (STRCMP(file[i] + len, "@en") == 0) | 4527 else if (STRCMP(file[i] + len, "@en") == 0) |
4527 { | 4528 { |
4528 /* Sorting on priority means the same item in another language may | 4529 /* Sorting on priority means the same item in another language may |
4529 * be anywhere. Search all items for a match up to the "@en". */ | 4530 * be anywhere. Search all items for a match up to the "@en". */ |
4531 if (j != i | 4532 if (j != i |
4532 && (int)STRLEN(file[j]) == len + 3 | 4533 && (int)STRLEN(file[j]) == len + 3 |
4533 && STRNCMP(file[i], file[j], len + 1) == 0) | 4534 && STRNCMP(file[i], file[j], len + 1) == 0) |
4534 break; | 4535 break; |
4535 if (j == num_file) | 4536 if (j == num_file) |
4536 { | 4537 /* item only exists with @en, remove it */ |
4537 file[i][len] = NUL; | 4538 file[i][len] = NUL; |
4538 break; | |
4539 } | |
4540 } | 4539 } |
4541 } | 4540 } |
4542 } | 4541 } |
4543 #endif | 4542 #endif |
4544 | 4543 |