vim-patch:9.0.0449: there is no easy way to translate a key code into a string (#20168)

Problem:    There is no easy way to translate a string with a key code into a
            readable string.
Solution:   Add the keytrans() function. (closes vim/vim#11114)
cdc839353f

vim-patch:7b2d87220c6c

Add missing part of patch
7b2d87220c
This commit is contained in:
zeertzjq
2022-09-13 06:23:33 +08:00
committed by GitHub
parent 91a150d0a9
commit 907fc8ac37
8 changed files with 61 additions and 9 deletions

View File

@@ -1681,8 +1681,8 @@ int msg_outtrans_special(const char *strstart, bool from, int maxlen)
/// Used for lhs or rhs of mappings.
///
/// @param[in] str String to convert.
/// @param[in] replace_spaces Convert spaces into `<Space>`, normally used fo
/// lhs, but not rhs.
/// @param[in] replace_spaces Convert spaces into `<Space>`, normally used for
/// lhs of mapping and keytrans(), but not rhs.
/// @param[in] replace_lt Convert `<` into `<lt>`.
///
/// @return [allocated] Converted string.
@@ -1704,8 +1704,8 @@ char *str2special_save(const char *const str, const bool replace_spaces, const b
/// Convert character, replacing key with printable representation.
///
/// @param[in,out] sp String to convert. Is advanced to the next key code.
/// @param[in] replace_spaces Convert spaces into <Space>, normally used for
/// lhs, but not rhs.
/// @param[in] replace_spaces Convert spaces into `<Space>`, normally used for
/// lhs of mapping and keytrans(), but not rhs.
/// @param[in] replace_lt Convert `<` into `<lt>`.
///
/// @return Converted key code, in a static buffer. Buffer is always one and the