summaryrefslogtreecommitdiff
path: root/Libraries/LibLine/Editor.cpp
diff options
context:
space:
mode:
authorNico Weber <thakis@chromium.org>2020-07-06 12:22:55 -0400
committerAndreas Kling <kling@serenityos.org>2020-07-06 22:41:35 +0200
commit8c82138b225337fb2131f001e4642c0b3c9dd9e7 (patch)
treec019f046ed97af891dfc56becea8bcbb53c870c6 /Libraries/LibLine/Editor.cpp
parent4726966ad78c6d1eba45ee901f5df2d52fc70c0b (diff)
downloadserenity-8c82138b225337fb2131f001e4642c0b3c9dd9e7.zip
LibLine: Put ctrl-key handlers in alphabetical order
Diffstat (limited to 'Libraries/LibLine/Editor.cpp')
-rw-r--r--Libraries/LibLine/Editor.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/Libraries/LibLine/Editor.cpp b/Libraries/LibLine/Editor.cpp
index 55ce3ac63e..8f357b8b2b 100644
--- a/Libraries/LibLine/Editor.cpp
+++ b/Libraries/LibLine/Editor.cpp
@@ -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;