mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-07 18:21:16 -03:00
Add 'and' input function; fixes a bug with t,T
'and' will prevent later input functions from being executed if the previous one did not succeed (e.g. a jump to a char not on the command line)
This commit is contained in:
@@ -3865,15 +3865,18 @@ const wchar_t *reader_readline(void)
|
||||
{
|
||||
wchar_t target = input_function_pop_arg();
|
||||
size_t len = data->command_length();
|
||||
bool status = false;
|
||||
|
||||
for(int i = data->buff_pos + 1; i < len; i++)
|
||||
{
|
||||
if(buff[i] == target)
|
||||
{
|
||||
update_buff_pos(i);
|
||||
status = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
input_function_set_status(status);
|
||||
reader_repaint();
|
||||
break;
|
||||
}
|
||||
@@ -3882,15 +3885,18 @@ const wchar_t *reader_readline(void)
|
||||
{
|
||||
wchar_t target = input_function_pop_arg();
|
||||
size_t len = data->command_length();
|
||||
bool status = false;
|
||||
|
||||
for(int i = data->buff_pos - 1; i >= 0; i--)
|
||||
{
|
||||
if(buff[i] == target)
|
||||
{
|
||||
update_buff_pos(i);
|
||||
status = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
input_function_set_status(status);
|
||||
reader_repaint();
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user