From f008e83eaebc16541854f9eaa9068cecb7fc9890 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Thu, 6 Aug 2020 20:30:19 -0400 Subject: [PATCH] LibLine: Add Ctrl-k shortcut Only does the 'delete to end of line' bit for now. No yank ring support yet. --- Libraries/LibLine/Editor.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Libraries/LibLine/Editor.cpp b/Libraries/LibLine/Editor.cpp index 9aa24f80c1..c53daddc88 100644 --- a/Libraries/LibLine/Editor.cpp +++ b/Libraries/LibLine/Editor.cpp @@ -965,6 +965,12 @@ void Editor::handle_read_event() do_backspace(); continue; } + // ^K + if (code_point == ctrl('K')) { + while (m_cursor < m_buffer.size()) + do_delete(); + continue; + } // ^L if (code_point == ctrl('L')) { printf("\033[3J\033[H\033[2J"); // Clear screen.