add editor_mode to agent settings

Smit Barmase and Oleksiy Syvokon created

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

Change summary

assets/settings/default.json                |  6 +++++-
crates/agent_settings/src/agent_settings.rs | 15 +++++++++++++++
2 files changed, 20 insertions(+), 1 deletion(-)

Detailed changes

assets/settings/default.json 🔗

@@ -885,7 +885,11 @@
     /// Whether to have terminal cards in the agent panel expanded, showing the whole command output.
     ///
     /// Default: true
-    "expand_terminal_card": true
+    "expand_terminal_card": true,
+    /// Weather to inherit or override the editor mode for the agent panel.
+    ///
+    /// Default: inherit
+    "editor_mode": "inherit"
   },
   // The settings for slash commands.
   "slash_commands": {

crates/agent_settings/src/agent_settings.rs 🔗

@@ -48,6 +48,16 @@ pub enum NotifyWhenAgentWaiting {
     Never,
 }
 
+#[derive(Copy, Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema, Default)]
+pub enum AgentEditorMode {
+    Vim,
+    VimInsert,
+    Helix,
+    Default,
+    #[default]
+    Inherit,
+}
+
 #[derive(Default, Clone, Debug)]
 pub struct AgentSettings {
     pub enabled: bool,
@@ -75,6 +85,7 @@ pub struct AgentSettings {
     pub expand_edit_card: bool,
     pub expand_terminal_card: bool,
     pub use_modifier_to_send: bool,
+    pub editor_mode: AgentEditorMode,
 }
 
 impl AgentSettings {
@@ -315,6 +326,10 @@ pub struct AgentSettingsContent {
     ///
     /// Default: false
     use_modifier_to_send: Option<bool>,
+    /// Weather to inherit or override the editor mode for the agent panel.
+    ///
+    /// Default: inherit
+    editor_mode: Option<AgentEditorMode>,
 }
 
 #[derive(Clone, Copy, Debug, Serialize, Deserialize, JsonSchema, PartialEq, Default)]