clean up

Smit Barmase and Oleksiy Syvokon created

Co-authored-by: Oleksiy Syvokon <oleksiy.syvokon@gmail.com>

Change summary

assets/settings/default.json           | 4 ++++
crates/zed/src/zed.rs                  | 2 +-
crates/zed/src/zed/quick_action_bar.rs | 4 ++--
3 files changed, 7 insertions(+), 3 deletions(-)

Detailed changes

assets/settings/default.json 🔗

@@ -111,6 +111,10 @@
   // 2. Maps `Control` on Linux and Windows and to `Command` on MacOS:
   //    "cmd_or_ctrl" (alias: "cmd", "ctrl")
   "multi_cursor_modifier": "alt",
+  /// Weather to set editor mode to vim, vim insert, helix, etc.
+  ///
+  /// Default: default
+  "editor_mode": "default",
   // Whether to enable vim modes and key bindings.
   "vim_mode": false,
   // Whether to enable helix mode and key bindings.

crates/zed/src/zed.rs 🔗

@@ -70,7 +70,7 @@ use ui::{PopoverMenuHandle, prelude::*};
 use util::markdown::MarkdownString;
 use util::{ResultExt, asset_str};
 use uuid::Uuid;
-use vim_mode_setting::{EditorMode, EditorModeSetting};
+use vim_mode_setting::EditorModeSetting;
 use workspace::notifications::{
     NotificationId, SuppressEvent, dismiss_app_notification, show_app_notification,
 };

crates/zed/src/zed/quick_action_bar.rs 🔗

@@ -578,9 +578,9 @@ impl Render for QuickActionBar {
                                 {
                                     move |window, cx| {
                                         let new_value = if vim_mode_enabled {
-                                            EditorMode::Default
+                                            EditorMode::default()
                                         } else {
-                                            EditorMode::Vim
+                                            EditorMode::vim()
                                         };
                                         EditorModeSetting::override_global(EditorModeSetting(new_value), cx);
                                         window.refresh();