mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 12:53:13 +00:00
More robust parsing of keybindings, allow sequences like \C-\ew and \C-?
darcs-hash:20060109152506-ac50b-0b040ba0aed86bf7f0b4a935f7842eccf1b45181.gz
This commit is contained in:
parent
b7c551a348
commit
8ed80deb6b
1 changed files with 16 additions and 2 deletions
18
input.c
18
input.c
|
@ -674,6 +674,8 @@ static wchar_t *input_expand_sequence( const wchar_t *in )
|
|||
*/
|
||||
case L'C':
|
||||
{
|
||||
int has_escape = 0;
|
||||
|
||||
in++;
|
||||
/* Make sure next key is a dash*/
|
||||
if( *in != L'-' )
|
||||
|
@ -683,17 +685,29 @@ static wchar_t *input_expand_sequence( const wchar_t *in )
|
|||
break;
|
||||
}
|
||||
in++;
|
||||
|
||||
if( (*in == L'\\') && (*(in+1)==L'e') )
|
||||
{
|
||||
has_escape = 1;
|
||||
in += 2;
|
||||
|
||||
}
|
||||
|
||||
|
||||
if( (*in >= L'a') &&
|
||||
(*in <= L'z') )
|
||||
(*in < L'a'+32) )
|
||||
{
|
||||
if( has_escape )
|
||||
*(out++)=L'\e';
|
||||
*(out++)=*in-L'a'+1;
|
||||
break;
|
||||
}
|
||||
|
||||
if( (*in >= L'A') &&
|
||||
(*in <= L'Z') )
|
||||
(*in < L'A'+32) )
|
||||
{
|
||||
if( has_escape )
|
||||
*(out++)=L'\e';
|
||||
*(out++)=*in-L'A'+1;
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue