@@ -3316,7 +3316,7 @@ static char_u *set_bool_option(int opt_idx, char_u *varp, int value, int opt_fla
33163316static char_u * set_num_option (int opt_idx , char_u * varp , long value , char_u * errbuf , size_t errbuflen , int opt_flags );
33173317static void check_redraw (long_u flags );
33183318static int findoption (char_u * );
3319- static int find_key_option (char_u * );
3319+ static int find_key_option (char_u * arg_arg , int has_lt );
33203320static void showoptions (int all , int opt_flags );
33213321static int optval_default (struct vimoption * , char_u * varp );
33223322static void showoneopt (struct vimoption * , int opt_flags );
@@ -4492,7 +4492,7 @@ do_set(
44924492 opt_idx = findoption (arg + 1 );
44934493 arg [len ++ ] = '>' ; /* restore '>' */
44944494 if (opt_idx == -1 )
4495- key = find_key_option (arg + 1 );
4495+ key = find_key_option (arg + 1 , TRUE );
44964496 }
44974497 else
44984498 {
@@ -4510,7 +4510,7 @@ do_set(
45104510 opt_idx = findoption (arg );
45114511 arg [len ] = nextchar ; /* restore nextchar */
45124512 if (opt_idx == -1 )
4513- key = find_key_option (arg );
4513+ key = find_key_option (arg , FALSE );
45144514 }
45154515
45164516 /* remember character after option name */
@@ -5362,7 +5362,7 @@ illegal_char(char_u *errbuf, int c)
53625362string_to_key (char_u * arg , int multi_byte )
53635363{
53645364 if (* arg == '<' )
5365- return find_key_option (arg + 1 );
5365+ return find_key_option (arg + 1 , TRUE );
53665366 if (* arg == '^' )
53675367 return Ctrl_chr (arg [1 ]);
53685368 if (multi_byte )
@@ -9541,7 +9541,7 @@ get_option_value(
95419541 int key ;
95429542
95439543 if (STRLEN (name ) == 4 && name [0 ] == 't' && name [1 ] == '_'
9544- && (key = find_key_option (name )) != 0 )
9544+ && (key = find_key_option (name , FALSE )) != 0 )
95459545 {
95469546 char_u key_name [2 ];
95479547 char_u * p ;
@@ -9831,7 +9831,7 @@ set_option_value(
98319831 int key ;
98329832
98339833 if (STRLEN (name ) == 4 && name [0 ] == 't' && name [1 ] == '_'
9834- && (key = find_key_option (name )) != 0 )
9834+ && (key = find_key_option (name , FALSE )) != 0 )
98359835 {
98369836 char_u key_name [2 ];
98379837
@@ -9952,20 +9952,23 @@ get_encoding_default(void)
99529952
99539953/*
99549954 * Translate a string like "t_xx", "<t_xx>" or "<S-Tab>" to a key number.
9955+ * When "has_lt" is true there is a '<' before "*arg_arg".
9956+ * Returns 0 when the key is not recognized.
99559957 */
99569958 static int
9957- find_key_option (char_u * arg )
9959+ find_key_option (char_u * arg_arg , int has_lt )
99589960{
9959- int key ;
9961+ int key = 0 ;
99609962 int modifiers ;
9963+ char_u * arg = arg_arg ;
99619964
99629965 /*
99639966 * Don't use get_special_key_code() for t_xx, we don't want it to call
99649967 * add_termcap_entry().
99659968 */
99669969 if (arg [0 ] == 't' && arg [1 ] == '_' && arg [2 ] && arg [3 ])
99679970 key = TERMCAP2KEY (arg [2 ], arg [3 ]);
9968- else
9971+ else if ( has_lt )
99699972 {
99709973 -- arg ; /* put arg at the '<' */
99719974 modifiers = 0 ;
0 commit comments