Jelajahi Sumber

LibGUI: Allow to uppercase conversion in Vim emulation

If Shift+Key_U is pressed while in visual mode, the currently selected
text will be converted to uppercase.
huttongrabiel 3 tahun lalu
induk
melakukan
e3bef71d05
1 mengubah file dengan 4 tambahan dan 3 penghapusan
  1. 4 3
      Userland/Libraries/LibGUI/VimEditingEngine.cpp

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

@@ -1145,6 +1145,10 @@ bool VimEditingEngine::on_key_in_visual_mode(KeyEvent const& event)
             move_to_logical_line_beginning();
             switch_to_insert_mode();
             return true;
+        case (KeyCode::Key_U):
+            casefold_selection(Casing::Uppercase);
+            switch_to_normal_mode();
+            return true;
         default:
             break;
         }
@@ -1174,9 +1178,6 @@ bool VimEditingEngine::on_key_in_visual_mode(KeyEvent const& event)
             m_editor->do_delete();
             switch_to_normal_mode();
             return true;
-        case (KeyCode::Key_U):
-            // FIXME: Set selection to uppercase.
-            return true;
         case (KeyCode::Key_X):
             yank(Selection);
             m_editor->do_delete();