Cancel pending rename when hitting `escape`

Antonio Scandurra created

Change summary

crates/editor/src/editor.rs | 4 ++++
1 file changed, 4 insertions(+)

Detailed changes

crates/editor/src/editor.rs 🔗

@@ -1452,6 +1452,10 @@ impl Editor {
     }
 
     pub fn cancel(&mut self, _: &Cancel, cx: &mut ViewContext<Self>) {
+        if self.take_rename(cx).is_some() {
+            return;
+        }
+
         if self.hide_context_menu(cx).is_some() {
             return;
         }