Rename sub_mode
to submode
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
a7a52ef3f7
commit
328be473e5
2 changed files with 4 additions and 4 deletions
|
@ -52,15 +52,15 @@ pub enum NormalState {
|
||||||
|
|
||||||
impl NormalState {
|
impl NormalState {
|
||||||
pub fn set_context(&self, context: &mut Context) {
|
pub fn set_context(&self, context: &mut Context) {
|
||||||
let sub_mode = match self {
|
let submode = match self {
|
||||||
Self::GPrefix => Some("g"),
|
Self::GPrefix => Some("g"),
|
||||||
_ => None,
|
_ => None,
|
||||||
};
|
};
|
||||||
|
|
||||||
if let Some(sub_mode) = sub_mode {
|
if let Some(submode) = submode {
|
||||||
context
|
context
|
||||||
.map
|
.map
|
||||||
.insert("vim_sub_mode".to_string(), sub_mode.to_string());
|
.insert("vim_submode".to_string(), submode.to_string());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ use crate::{mode::Mode, SwitchMode, VimState};
|
||||||
action!(MoveToStart);
|
action!(MoveToStart);
|
||||||
|
|
||||||
pub fn init(cx: &mut MutableAppContext) {
|
pub fn init(cx: &mut MutableAppContext) {
|
||||||
let context = Some("Editor && vim_mode == normal && vim_sub_mode == g");
|
let context = Some("Editor && vim_mode == normal && vim_submode == g");
|
||||||
cx.add_bindings(vec![
|
cx.add_bindings(vec![
|
||||||
Binding::new("g", MoveToStart, context),
|
Binding::new("g", MoveToStart, context),
|
||||||
Binding::new("escape", SwitchMode(Mode::normal()), context),
|
Binding::new("escape", SwitchMode(Mode::normal()), context),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue