char_u *str,
int replace_spaces, // TRUE to replace " " with "<Space>".
// used for the lhs of mapping and keytrans().
- int replace_lt) // TRUE to replace "<" with "<lt>".
+ int replace_others) // TRUE to replace "<" with "<lt>",
+ // "|" with "<Bar>", "\" with "<Bslash>".
{
garray_T ga;
char_u *p = str;
ga_init2(&ga, 1, 40);
while (*p != NUL)
- ga_concat(&ga, str2special(&p, replace_spaces, replace_lt));
+ ga_concat(&ga, str2special(&p, replace_spaces, replace_others));
ga_append(&ga, NUL);
return (char_u *)ga.ga_data;
}
char_u **sp,
int replace_spaces, // TRUE to replace " " with "<Space>".
// used for the lhs of mapping and keytrans().
- int replace_lt) // TRUE to replace "<" with "<lt>".
+ int replace_others) // TRUE to replace "<" with "<lt>",
+ // "|" with "<Bar>", "\" with "<Bslash>".
{
int c;
static char_u buf[7];
if (special
|| c < ' '
|| (replace_spaces && c == ' ')
- || (replace_lt && c == '<'))
+ || (replace_others && (c == '<' || c == '|' || c == '\\')))
return get_special_key_name(c, modifiers);
buf[0] = c;
buf[1] = NUL;
int msg_outtrans_len_attr(char_u *msgstr, int len, int attr);
void msg_make(char_u *arg);
int msg_outtrans_special(char_u *strstart, int from, int maxlen);
-char_u *str2special_save(char_u *str, int replace_spaces, int replace_lt);
-char_u *str2special(char_u **sp, int replace_spaces, int replace_lt);
+char_u *str2special_save(char_u *str, int replace_spaces, int replace_others);
+char_u *str2special(char_u **sp, int replace_spaces, int replace_others);
void str2specialbuf(char_u *sp, char_u *buf, int len);
void msg_prt_line(char_u *s, int list);
void msg_puts(char *s);
call assert_equal('<M-x>', "\<*M-x>"->keytrans())
call assert_equal('<C-I>', "\<*C-I>"->keytrans())
call assert_equal('<S-3>', "\<*S-3>"->keytrans())
+ call assert_equal('<Bar>', '|'->keytrans())
+ call assert_equal('<M-Bar>', "\<*M-|>"->keytrans())
+ call assert_equal('<Bslash>', '\'->keytrans())
+ call assert_equal('<M-Bslash>', "\<*M-\>"->keytrans())
call assert_equal('π', 'π'->keytrans())
call assert_equal('<M-π>', "\<M-π>"->keytrans())
call assert_equal('ě', 'ě'->keytrans())
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 680,
/**/
679,
/**/