mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-11 21:13:02 +00:00
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) {
|
||||
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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue