From 685536c27ee06b63a4fa3bce564e114e3d2da092 Mon Sep 17 00:00:00 2001 From: Ben Kunkle Date: Fri, 14 Mar 2025 13:42:00 -0500 Subject: [PATCH] editor: Change order of format and timeout futures (#26796) Very small change, simply changing the order of the futures we pass to `select_biased!` so that if the format request and the timeout resolve at the same time (highly unlikely) we choose the format request instead of choosing the timeout and throwing away our work! Release Notes: - N/A --- crates/editor/src/editor.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index 34b25dcbea1956910080b765eb32c016ec379463..237c68491a94f1447d38997a970ad24fcde8c7ba 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -12820,11 +12820,11 @@ impl Editor { cx.spawn_in(window, |_, mut cx| async move { let transaction = futures::select_biased! { + transaction = format.log_err().fuse() => transaction, () = timeout => { log::warn!("timed out waiting for formatting"); None } - transaction = format.log_err().fuse() => transaction, }; buffer