Don't reset vim mode on editor focus

This commit is contained in:
Keith Simmons 2022-05-02 11:48:46 -07:00
parent b2138f5935
commit 797aecf7c1

View file

@ -18,15 +18,11 @@ fn editor_created(EditorCreated(editor): &EditorCreated, cx: &mut MutableAppCont
}
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| {
state.active_editor = Some(editor.downgrade());
state.switch_mode(mode, cx);
if editor.read(cx).mode() != EditorMode::Full {
state.switch_mode(Mode::Insert, cx);
}
});
}