@@ -882,11 +882,11 @@ server_client_handle_key(struct client *c, key_code key)
882
882
883
883
/* Forward mouse keys if disabled. */
884
884
if (KEYC_IS_MOUSE (key ) && !options_get_number (s -> options , "mouse" ))
885
- goto forward ;
885
+ goto forward_key ;
886
886
887
887
/* Treat everything as a regular key when pasting is detected. */
888
888
if (!KEYC_IS_MOUSE (key ) && server_client_assume_paste (s ))
889
- goto forward ;
889
+ goto forward_key ;
890
890
891
891
/*
892
892
* Work out the current key table. If the pane is in a mode, use
@@ -901,12 +901,12 @@ server_client_handle_key(struct client *c, key_code key)
901
901
table = c -> keytable ;
902
902
first = table ;
903
903
904
+ table_changed :
904
905
/*
905
906
* The prefix always takes precedence and forces a switch to the prefix
906
907
* table, unless we are already there.
907
908
*/
908
909
key0 = (key & ~KEYC_XTERM );
909
- retry :
910
910
if ((key0 == (key_code )options_get_number (s -> options , "prefix" ) ||
911
911
key0 == (key_code )options_get_number (s -> options , "prefix2" )) &&
912
912
strcmp (table -> name , "prefix" ) != 0 ) {
@@ -924,6 +924,7 @@ server_client_handle_key(struct client *c, key_code key)
924
924
if (c -> flags & CLIENT_REPEAT )
925
925
log_debug ("currently repeating" );
926
926
927
+ try_again :
927
928
/* Try to see if there is a key binding in the current table. */
928
929
bd_find .key = key0 ;
929
930
bd = RB_FIND (key_bindings , & table -> key_bindings , & bd_find );
@@ -939,7 +940,7 @@ server_client_handle_key(struct client *c, key_code key)
939
940
c -> flags &= ~CLIENT_REPEAT ;
940
941
server_status_client (c );
941
942
table = c -> keytable ;
942
- goto retry ;
943
+ goto table_changed ;
943
944
}
944
945
log_debug ("found in key table %s" , table -> name );
945
946
@@ -974,21 +975,25 @@ server_client_handle_key(struct client *c, key_code key)
974
975
}
975
976
976
977
/*
977
- * No match in this table. If not in the root table or if repeating,
978
- * switch the client back to the root table and try again.
978
+ * No match, try the ANY key.
979
979
*/
980
- log_debug ("not found in key table %s" , table -> name );
981
980
if (key0 != KEYC_ANY ) {
982
981
key0 = KEYC_ANY ;
983
- goto retry ;
982
+ goto try_again ;
984
983
}
984
+
985
+ /*
986
+ * No match in this table. If not in the root table or if repeating,
987
+ * switch the client back to the root table and try again.
988
+ */
989
+ log_debug ("not found in key table %s" , table -> name );
985
990
if (!server_client_is_default_key_table (c , table ) ||
986
991
(c -> flags & CLIENT_REPEAT )) {
987
992
server_client_set_key_table (c , NULL );
988
993
c -> flags &= ~CLIENT_REPEAT ;
989
994
server_status_client (c );
990
995
table = c -> keytable ;
991
- goto retry ;
996
+ goto table_changed ;
992
997
}
993
998
994
999
/*
@@ -1001,7 +1006,7 @@ server_client_handle_key(struct client *c, key_code key)
1001
1006
return ;
1002
1007
}
1003
1008
1004
- forward :
1009
+ forward_key :
1005
1010
if (c -> flags & CLIENT_READONLY )
1006
1011
return ;
1007
1012
if (wp != NULL )
0 commit comments