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
commit21e5662125774c5f16b70be1173c673a4fdb1176
authorOmnikar <omkar.subramaniam@icloud.com>
dateMon 9 Aug 2021, 21:57 (5 years ago)
parenta4564ad
helix-term/src/commands.rs+4−1
@@ -2560,7 +2560,10 @@ fn select_mode(cx: &mut Context) {
25602560}
25612561
25622562fn exit_select_mode(cx: &mut Context) {
2563− doc_mut!(cx.editor).mode = Mode::Normal;
2563+ let doc = doc_mut!(cx.editor);
2564+ if doc.mode == Mode::Select {
2565+ doc.mode = Mode::Normal;
2566+ }
25642567}
25652568
25662569fn goto_impl(