Преглед на файлове

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 години
родител
ревизия
e3bef71d05
променени са 1 файла, в които са добавени 4 реда и са изтрити 3 реда
  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();
             move_to_logical_line_beginning();
             switch_to_insert_mode();
             switch_to_insert_mode();
             return true;
             return true;
+        case (KeyCode::Key_U):
+            casefold_selection(Casing::Uppercase);
+            switch_to_normal_mode();
+            return true;
         default:
         default:
             break;
             break;
         }
         }
@@ -1174,9 +1178,6 @@ bool VimEditingEngine::on_key_in_visual_mode(KeyEvent const& event)
             m_editor->do_delete();
             m_editor->do_delete();
             switch_to_normal_mode();
             switch_to_normal_mode();
             return true;
             return true;
-        case (KeyCode::Key_U):
-            // FIXME: Set selection to uppercase.
-            return true;
         case (KeyCode::Key_X):
         case (KeyCode::Key_X):
             yank(Selection);
             yank(Selection);
             m_editor->do_delete();
             m_editor->do_delete();