Send SaveBuffer message on foreground thread

Max Brunsfeld and Nathan Sobo created

This ensures that it gets sent *after* any other messages
for which we have already spawned a foreground send.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>

Change summary

zed/src/worktree.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Detailed changes

zed/src/worktree.rs 🔗

@@ -1639,7 +1639,7 @@ impl File {
             Worktree::Remote(worktree) => {
                 let rpc = worktree.rpc.clone();
                 let worktree_id = worktree.remote_id;
-                cx.background().spawn(async move {
+                cx.foreground().spawn(async move {
                     let response = rpc
                         .request(proto::SaveBuffer {
                             worktree_id,