@@ -3269,7 +3269,6 @@ static void set_options_default(int opt_flags);
32693269static char_u * term_bg_default (void );
32703270static void did_set_option (int opt_idx , int opt_flags , int new_value );
32713271static char_u * illegal_char (char_u * , int );
3272- static int string_to_key (char_u * arg );
32733272#ifdef FEAT_CMDWIN
32743273static char_u * check_cedit (void );
32753274#endif
@@ -4763,7 +4762,7 @@ do_set(
47634762 && (!arg [1 ] || VIM_ISWHITE (arg [1 ]))
47644763 && !VIM_ISDIGIT (* arg ))))
47654764 {
4766- value = string_to_key (arg );
4765+ value = string_to_key (arg , FALSE );
47674766 if (value == 0 && (long * )varp != & p_wcm )
47684767 {
47694768 errmsg = e_invarg ;
@@ -5320,14 +5319,17 @@ illegal_char(char_u *errbuf, int c)
53205319/*
53215320 * Convert a key name or string into a key value.
53225321 * Used for 'wildchar' and 'cedit' options.
5322+ * When "multi_byte" is TRUE allow for multi-byte characters.
53235323 */
5324- static int
5325- string_to_key (char_u * arg )
5324+ int
5325+ string_to_key (char_u * arg , int multi_byte )
53265326{
53275327 if (* arg == '<' )
53285328 return find_key_option (arg + 1 );
53295329 if (* arg == '^' )
53305330 return Ctrl_chr (arg [1 ]);
5331+ if (multi_byte )
5332+ return PTR2CHAR (arg );
53315333 return * arg ;
53325334}
53335335
@@ -5345,7 +5347,7 @@ check_cedit(void)
53455347 cedit_key = -1 ;
53465348 else
53475349 {
5348- n = string_to_key (p_cedit );
5350+ n = string_to_key (p_cedit , FALSE );
53495351 if (vim_isprintc (n ))
53505352 return e_invarg ;
53515353 cedit_key = n ;
@@ -7462,6 +7464,12 @@ did_set_string_option(
74627464#endif
74637465
74647466#ifdef FEAT_TERMINAL
7467+ /* 'termkey' */
7468+ else if (varp == & curwin -> w_p_tms )
7469+ {
7470+ if (* curwin -> w_p_tk != NUL && string_to_key (curwin -> w_p_tk , TRUE) == 0 )
7471+ errmsg = e_invarg ;
7472+ }
74657473 /* 'termsize' */
74667474 else if (varp == & curwin -> w_p_tms )
74677475 {
0 commit comments