mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-14 05:53:59 +00:00
Fix issue with ^W and other shortcurs sometimes not deleting anything
darcs-hash:20060916230532-ac50b-395d34e2c67d2be3d634638265a98239442fd6cd.gz
This commit is contained in:
parent
4399503f4e
commit
6be3807cae
1 changed files with 21 additions and 6 deletions
27
reader.c
27
reader.c
|
@ -2006,7 +2006,10 @@ static void move_word( int dir, int erase )
|
||||||
|
|
||||||
end_buff_pos--;
|
end_buff_pos--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Remove all whitespace characters before finding a word
|
||||||
|
*/
|
||||||
while( 1 )
|
while( 1 )
|
||||||
{
|
{
|
||||||
wchar_t c;
|
wchar_t c;
|
||||||
|
@ -2022,16 +2025,28 @@ static void move_word( int dir, int erase )
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
c = data->buff[end_buff_pos];
|
/*
|
||||||
|
Always eat at least one character
|
||||||
if( !iswspace( c ) )
|
*/
|
||||||
|
if( end_buff_pos != data->buff_pos )
|
||||||
{
|
{
|
||||||
break;
|
|
||||||
|
c = data->buff[end_buff_pos];
|
||||||
|
|
||||||
|
if( !iswspace( c ) )
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
end_buff_pos+=step;
|
end_buff_pos+=step;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Remove until we find a character that is not alphanumeric
|
||||||
|
*/
|
||||||
while( 1 )
|
while( 1 )
|
||||||
{
|
{
|
||||||
wchar_t c;
|
wchar_t c;
|
||||||
|
@ -2056,7 +2071,7 @@ static void move_word( int dir, int erase )
|
||||||
whitespace, but do for all other non-alphabetic
|
whitespace, but do for all other non-alphabetic
|
||||||
characters
|
characters
|
||||||
*/
|
*/
|
||||||
if( iswspace( c ) )
|
if( iswspace( c ) /* && ( abs( end_buff_pos-data->buff_pos ) > 1 ) */)
|
||||||
end_buff_pos -= step;
|
end_buff_pos -= step;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue