Make exit_select_mode check current mode (#568)

Change `exit_select_mode` to check that the current mode is select mode
before switching to normal mode
This commit is contained in:
Omnikar 2021-08-09 21:57:07 -04:00 committed by GitHub
parent a4564adadd
commit 21e5662125
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2560,7 +2560,10 @@ fn select_mode(cx: &mut Context) {
} }
fn exit_select_mode(cx: &mut Context) { fn exit_select_mode(cx: &mut Context) {
doc_mut!(cx.editor).mode = Mode::Normal; let doc = doc_mut!(cx.editor);
if doc.mode == Mode::Select {
doc.mode = Mode::Normal;
}
} }
fn goto_impl( fn goto_impl(