From 7b71554b58615298b18fcc220331f36101ac54d4 Mon Sep 17 00:00:00 2001 From: ForLoveOfCats Date: Thu, 11 Aug 2022 13:52:19 -0400 Subject: [PATCH] Don't scroll to cursor when performing file save --- crates/editor/src/items.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/crates/editor/src/items.rs b/crates/editor/src/items.rs index cb7632d5e2..58bbda2e4d 100644 --- a/crates/editor/src/items.rs +++ b/crates/editor/src/items.rs @@ -397,7 +397,7 @@ impl Item for Editor { let buffers = buffer.read(cx).all_buffers(); let mut timeout = cx.background().timer(FORMAT_TIMEOUT).fuse(); let format = project.update(cx, |project, cx| project.format(buffers, true, cx)); - cx.spawn(|this, mut cx| async move { + cx.spawn(|_, mut cx| async move { let transaction = futures::select_biased! { _ = timeout => { log::warn!("timed out waiting for formatting"); @@ -406,9 +406,6 @@ impl Item for Editor { transaction = format.log_err().fuse() => transaction, }; - this.update(&mut cx, |editor, cx| { - editor.request_autoscroll(Autoscroll::Fit, cx) - }); buffer .update(&mut cx, |buffer, cx| { if let Some(transaction) = transaction {