From 21e5662125774c5f16b70be1173c673a4fdb1176 Mon Sep 17 00:00:00 2001 From: Omnikar Date: Mon, 9 Aug 2021 21:57:07 -0400 Subject: [PATCH] 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 --- helix-term/src/commands.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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(