From 8c82138b225337fb2131f001e4642c0b3c9dd9e7 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Mon, 6 Jul 2020 12:22:55 -0400 Subject: [PATCH] LibLine: Put ctrl-key handlers in alphabetical order --- Libraries/LibLine/Editor.cpp | 20 ++++++++++---------- 1 file 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;