From 62e5947b76fbc319f7dc96efb0daadf4ebe0da64 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Fri, 18 Feb 2022 15:24:24 +0100 Subject: [PATCH] Cancel pending rename when hitting `escape` --- crates/editor/src/editor.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index 20126bb89e8ffc5a121238d573303038815b6a44..ae3c10495f0f734516473ecfed36b80bc96d0828 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -1452,6 +1452,10 @@ impl Editor { } pub fn cancel(&mut self, _: &Cancel, cx: &mut ViewContext) { + if self.take_rename(cx).is_some() { + return; + } + if self.hide_context_menu(cx).is_some() { return; }