From 7956a9a547949cf826d3e30f46c12a7edef67316 Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Tue, 13 Feb 2024 21:45:46 -0700 Subject: [PATCH] Don't wait to dispatch commands (#7755) I added this when porting vim mode to gpui2 to work around life-cycle problems. Since #7647, this is no longer needed for vim mode, and causes other problems (c.f. #7748) Release Notes: - Improved command to drop fewer keystrokes --- crates/command_palette/src/command_palette.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/crates/command_palette/src/command_palette.rs b/crates/command_palette/src/command_palette.rs index 5e7f5938ef..50ededd122 100644 --- a/crates/command_palette/src/command_palette.rs +++ b/crates/command_palette/src/command_palette.rs @@ -317,9 +317,7 @@ impl PickerDelegate for CommandPaletteDelegate { }); let action = command.action; cx.focus(&self.previous_focus_handle); - cx.window_context() - .spawn(move |mut cx| async move { cx.update(|cx| cx.dispatch_action(action)) }) - .detach_and_log_err(cx); + cx.dispatch_action(action); self.dismissed(cx); }