reader: Don't handle escape specially

Escape is just another ordinary character that you can bind, or not.
This commit is contained in:
Fabian Homborg 2019-05-24 19:02:53 +02:00
parent dd4e0a3b6d
commit 1fd627ebd3

View File

@ -3278,16 +3278,8 @@ maybe_t<wcstring> reader_data_t::readline(int nchars_or_0) {
} else {
// Ordinary char.
wchar_t c = event_needing_handling->get_char();
if (c == L'\x1B') {
// Escape was pressed.
if (history_search.active()) {
history_search.go_to_end();
update_command_line_from_history_search();
history_search.reset();
}
assert(!history_search.active());
} else if (!fish_reserved_codepoint(c) && (c >= L' ' || c == L'\n' || c == L'\r') &&
c != 0x7F) {
if (!fish_reserved_codepoint(c) && (c >= L' ' || c == L'\n' || c == L'\r') &&
c != 0x7F) {
// Regular character.
editable_line_t *el = active_edit_line();
insert_char(active_edit_line(), c);