Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Add a next_mode to vim::Paste instead of hard-coding Normal mode (#27897)

jneem9949512b64ab
diff --git a/crates/vim/src/normal/paste.rs b/crates/vim/src/normal/paste.rs
index 3f3e27c4579..d869a05e5cf 100644
--- a/crates/vim/src/normal/paste.rs
+++ b/crates/vim/src/normal/paste.rs
@@ -3,10 +3,11 @@ use gpui::{Context, Window, impl_actions};
use language::{Bias, SelectionGoal};
use schemars::JsonSchema;
use serde::Deserialize;
+use settings::Settings;
use std::cmp;
use crate::{
- Vim,
+ Vim, VimSettings,
motion::{Motion, MotionKind},
object::Object,
state::{Mode, Register},
@@ -203,7 +204,8 @@ impl Vim {
})
});
});
- self.switch_mode(Mode::Normal, true, window, cx);
+ let next_mode = VimSettings::get_global(cx).default_mode;
+ self.switch_mode(next_mode, true, window, cx);
}
pub fn replace_with_register_object(