mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-04 07:21:14 -03:00
make cursor placement consistent with transpose-words from readline
This commit is contained in:
committed by
ridiculousfish
parent
a259c37415
commit
03e36bda72
@@ -3555,7 +3555,6 @@ const wchar_t *reader_readline(void)
|
|||||||
|
|
||||||
case R_TRANSPOSE_WORDS:
|
case R_TRANSPOSE_WORDS:
|
||||||
{
|
{
|
||||||
size_t orig_pos = data->buff_pos;
|
|
||||||
size_t len = data->command_length();
|
size_t len = data->command_length();
|
||||||
const wchar_t *buff = data->command_line.c_str();
|
const wchar_t *buff = data->command_line.c_str();
|
||||||
const wchar_t *tok_begin, *tok_end, *prev_begin, *prev_end;
|
const wchar_t *tok_begin, *tok_end, *prev_begin, *prev_end;
|
||||||
@@ -3588,7 +3587,8 @@ const wchar_t *reader_readline(void)
|
|||||||
new_buff.append(sep);
|
new_buff.append(sep);
|
||||||
new_buff.append(prev);
|
new_buff.append(prev);
|
||||||
new_buff.append(trail);
|
new_buff.append(trail);
|
||||||
set_command_line_and_position(new_buff, orig_pos);
|
/* Put cursor right after the second token */
|
||||||
|
set_command_line_and_position(new_buff, tok_end - buff);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user