LibLine: Put ctrl-key handlers in alphabetical order

This commit is contained in:
Nico Weber
2020-07-06 12:22:55 -04:00
committed by Andreas Kling
parent 4726966ad7
commit 8c82138b22

View File

@@ -749,6 +749,16 @@ void Editor::handle_read_event()
m_refresh_needed = true;
continue;
}
// ^A
if (codepoint == ctrl('A')) {
m_cursor = 0;
continue;
}
// ^E
if (codepoint == ctrl('E')) {
m_cursor = m_buffer.size();
continue;
}
// ^L
if (codepoint == ctrl('L')) {
printf("\033[3J\033[H\033[2J"); // Clear screen.
@@ -757,11 +767,6 @@ void Editor::handle_read_event()
m_refresh_needed = true;
continue;
}
// ^A
if (codepoint == ctrl('A')) {
m_cursor = 0;
continue;
}
// ^R
if (codepoint == ctrl('R')) {
if (m_is_searching) {
@@ -890,11 +895,6 @@ void Editor::handle_read_event()
}
continue;
}
// ^E
if (codepoint == ctrl('E')) {
m_cursor = m_buffer.size();
continue;
}
if (codepoint == '\n') {
finish();
continue;