aboutsummaryrefslogtreecommitdiff
path: root/helix-term
diff options
context:
space:
mode:
authorOmnikar2021-08-10 01:57:07 +0000
committerGitHub2021-08-10 01:57:07 +0000
commit21e5662125774c5f16b70be1173c673a4fdb1176 (patch)
treedb9bb889e98fa125f139f2ead47843fec8524961 /helix-term
parenta4564adadd1f77850b92d772e58c6457e14ecc3c (diff)
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
Diffstat (limited to 'helix-term')
-rw-r--r--helix-term/src/commands.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index 29be5ccd..f8c5d480 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -2560,7 +2560,10 @@ fn 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(