Переглянути джерело

LibGUI: Allow to lowercase conversion in Vim emulation

If Key_U is pressed while in visual mode, the currently selected text
will be converted to lowercase.
huttongrabiel 3 роки тому
батько
коміт
a54b681149
1 змінених файлів з 4 додано та 0 видалено
  1. 4 0
      Userland/Libraries/LibGUI/VimEditingEngine.cpp

+ 4 - 0
Userland/Libraries/LibGUI/VimEditingEngine.cpp

@@ -1195,6 +1195,10 @@ bool VimEditingEngine::on_key_in_visual_mode(KeyEvent const& event)
             yank(Selection);
             yank(Selection);
             switch_to_normal_mode();
             switch_to_normal_mode();
             return true;
             return true;
+        case (KeyCode::Key_U):
+            casefold_selection(Casing::Lowercase);
+            switch_to_normal_mode();
+            return true;
         case (KeyCode::Key_PageUp):
         case (KeyCode::Key_PageUp):
             move_page_up();
             move_page_up();
             update_selection_on_cursor_move();
             update_selection_on_cursor_move();