1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-24 17:57:35 +00:00

LibLine: Do not reset suggestion state immediately when encountering esc

Some multikey binding might depend on the suggestion state, and this is
indeed the case for 'reverse tab', which is just '^[[Z'.
Fixes #3407.
This commit is contained in:
AnotherTest 2020-09-06 02:27:30 +04:30 committed by Andreas Kling
parent 4c317a94c7
commit 521475dc01

View file

@ -664,6 +664,13 @@ void Editor::handle_read_event()
ctrl_held = true; ctrl_held = true;
continue; continue;
} }
if (code_point == 'Z') {
// 'reverse tab'
reverse_tab = true;
m_state = InputState::Free;
ctrl_held = false;
break;
}
cleanup_suggestions(); cleanup_suggestions();
switch (code_point) { switch (code_point) {
case 'A': // ^[[A: arrow up case 'A': // ^[[A: arrow up
@ -702,11 +709,6 @@ void Editor::handle_read_event()
m_state = InputState::Free; m_state = InputState::Free;
ctrl_held = false; ctrl_held = false;
continue; continue;
case 'Z': // ^[[Z: shift+tab
reverse_tab = true;
m_state = InputState::Free;
ctrl_held = false;
break;
case '3': // ^[[3~: delete case '3': // ^[[3~: delete
erase_character_forwards(); erase_character_forwards();
m_search_offset = 0; m_search_offset = 0;
@ -726,7 +728,6 @@ void Editor::handle_read_event()
case InputState::Free: case InputState::Free:
if (code_point == 27) { if (code_point == 27) {
m_state = InputState::GotEscape; m_state = InputState::GotEscape;
cleanup_suggestions();
continue; continue;
} }
break; break;