diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-05-03 15:13:57 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-05-03 15:13:57 +0200 |
commit | 2cb9f0253228478ec27265ff40f59c629874d695 (patch) | |
tree | 080e9fd1c1fbb7aa76c23ffe77872cef0b0f9d97 /src/term.c | |
parent | d788543ac6996536c532bceb7bbff51cd38d8699 (diff) | |
download | vim-git-8.1.1251.tar.gz |
patch 8.1.1251: no test for completion of mapping keysv8.1.1251
Problem: No test for completion of mapping keys.
Solution: Add a test. Also clean up the code.
Diffstat (limited to 'src/term.c')
-rw-r--r-- | src/term.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/term.c b/src/term.c index 6fa519b4f..08a55632f 100644 --- a/src/term.c +++ b/src/term.c @@ -6629,22 +6629,20 @@ check_for_codes_from_term(void) #if defined(FEAT_CMDL_COMPL) || defined(PROTO) /* * Translate an internal mapping/abbreviation representation into the - * corresponding external one recognized by :map/:abbrev commands; - * respects the current B/k/< settings of 'cpoption'. + * corresponding external one recognized by :map/:abbrev commands. + * Respects the current B/k/< settings of 'cpoption'. * * This function is called when expanding mappings/abbreviations on the - * command-line, and for building the "Ambiguous mapping..." error message. + * command-line. * - * It uses a growarray to build the translation string since the - * latter can be wider than the original description. The caller has to - * free the string afterwards. + * It uses a growarray to build the translation string since the latter can be + * wider than the original description. The caller has to free the string + * afterwards. * * Returns NULL when there is a problem. */ char_u * -translate_mapping( - char_u *str, - int expmap) /* TRUE when expanding mappings on command-line */ +translate_mapping(char_u *str) { garray_T ga; int c; @@ -6691,7 +6689,7 @@ translate_mapping( } if (c == K_SPECIAL && str[1] != NUL && str[2] != NUL) { - if (expmap && cpo_special) + if (cpo_special) { ga_clear(&ga); return NULL; @@ -6703,7 +6701,7 @@ translate_mapping( } if (IS_SPECIAL(c) || modifiers) /* special key */ { - if (expmap && cpo_special) + if (cpo_special) { ga_clear(&ga); return NULL; |