Don't reset vim mode on editor focus
This commit is contained in:
parent
b2138f5935
commit
797aecf7c1
1 changed files with 3 additions and 7 deletions
|
@ -18,15 +18,11 @@ fn editor_created(EditorCreated(editor): &EditorCreated, cx: &mut MutableAppCont
|
||||||
}
|
}
|
||||||
|
|
||||||
fn editor_focused(EditorFocused(editor): &EditorFocused, cx: &mut MutableAppContext) {
|
fn editor_focused(EditorFocused(editor): &EditorFocused, cx: &mut MutableAppContext) {
|
||||||
let mode = if matches!(editor.read(cx).mode(), EditorMode::SingleLine) {
|
|
||||||
Mode::Insert
|
|
||||||
} else {
|
|
||||||
Mode::Normal
|
|
||||||
};
|
|
||||||
|
|
||||||
Vim::update(cx, |state, cx| {
|
Vim::update(cx, |state, cx| {
|
||||||
state.active_editor = Some(editor.downgrade());
|
state.active_editor = Some(editor.downgrade());
|
||||||
state.switch_mode(mode, cx);
|
if editor.read(cx).mode() != EditorMode::Full {
|
||||||
|
state.switch_mode(Mode::Insert, cx);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue