Procházet zdrojové kódy

LibLine: Add Ctrl-k shortcut

Only does the 'delete to end of line' bit for now.
No yank ring support yet.
Nico Weber před 5 roky
rodič
revize
f008e83eae
1 změnil soubory, kde provedl 6 přidání a 0 odebrání
  1. 6 0
      Libraries/LibLine/Editor.cpp

+ 6 - 0
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.