Procházet zdrojové kódy

GTextEditor: Ctrl+A should select the entire document.

Andreas Kling před 6 roky
rodič
revize
5602f3be6c
1 změnil soubory, kde provedl 6 přidání a 0 odebrání
  1. 6 0
      LibGUI/GTextEditor.cpp

+ 6 - 0
LibGUI/GTextEditor.cpp

@@ -294,6 +294,12 @@ void GTextEditor::keydown_event(GKeyEvent& event)
         set_cursor(line_count() - 1, m_lines[line_count() - 1]->length());
         set_cursor(line_count() - 1, m_lines[line_count() - 1]->length());
         return;
         return;
     }
     }
+    if (event.modifiers() == Mod_Ctrl && event.key() == KeyCode::Key_A) {
+        m_selection_start = { 0, 0 };
+        set_cursor(line_count() - 1, m_lines[line_count() - 1]->length());
+        update();
+        return;
+    }
 
 
     if (!event.modifiers() && event.key() == KeyCode::Key_Backspace) {
     if (!event.modifiers() && event.key() == KeyCode::Key_Backspace) {
         if (has_selection()) {
         if (has_selection()) {