Skip to content

Commit

Permalink
ensure that all pending writes are flushed on :write and :write-all (h…
Browse files Browse the repository at this point in the history
  • Loading branch information
lpoirothattermann committed May 18, 2024
1 parent 2301430 commit 49d4921
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions helix-term/src/commands/typed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,8 @@ fn write_impl(
cx.editor.save(id, path, force)?;
}

cx.block_try_flush_writes()?;

Ok(())
}

Expand Down Expand Up @@ -623,7 +625,6 @@ fn write_quit(
}

write_impl(cx, args.first(), false)?;
cx.block_try_flush_writes()?;
quit(cx, &[], event)
}

Expand All @@ -637,7 +638,6 @@ fn force_write_quit(
}

write_impl(cx, args.first(), true)?;
cx.block_try_flush_writes()?;
force_quit(cx, &[], event)
}

Expand Down Expand Up @@ -730,6 +730,8 @@ pub fn write_all_impl(
bail!("{:?}", errors);
}

cx.block_try_flush_writes()?;

Ok(())
}

Expand Down

0 comments on commit 49d4921

Please sign in to comment.