vim: Fix escape key switching back to default mode instead of normal mode (#31843)
Closes #31728 This PR introduced new setting `"helix_mode"`. Enabling which will enable the `vim_mode` along with `helix` behavior. This solves issue where `vim`'s `default_mode` was being used to switch between mode instead of opening in `default_mode`. When `helix_mode` is enabled switcing to `Normal mode` will now switch to `HelixNormal` Release Notes: - Fixed - escape key not switching to normal mode when default_mode is insert - Added - `helix_mode` setting to enable/disable helix key bindings --------- Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
This commit is contained in:
parent
d2ca68bd5d
commit
ab189b898d
8 changed files with 72 additions and 14 deletions
|
@ -3,7 +3,9 @@ use gpui::{Context, Window, impl_actions};
|
|||
use language::{Bias, SelectionGoal};
|
||||
use schemars::JsonSchema;
|
||||
use serde::Deserialize;
|
||||
use settings::Settings;
|
||||
use std::cmp;
|
||||
use vim_mode_setting::HelixModeSetting;
|
||||
|
||||
use crate::{
|
||||
Vim,
|
||||
|
@ -218,7 +220,11 @@ impl Vim {
|
|||
});
|
||||
});
|
||||
|
||||
self.switch_mode(self.default_mode(cx), true, window, cx);
|
||||
if HelixModeSetting::get_global(cx).0 {
|
||||
self.switch_mode(Mode::HelixNormal, true, window, cx);
|
||||
} else {
|
||||
self.switch_mode(Mode::Normal, true, window, cx);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn replace_with_register_object(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue