Skip to content

Commit

Permalink
flush writes on force quit
Browse files Browse the repository at this point in the history
When force quitting, we need to block on the pending writes to ensure
that write commands succeed before exiting, and also to avoid a crash
when all the views are gone before the auto format call returns from
the LS.
  • Loading branch information
dead10ck committed Oct 21, 2022
1 parent fbf8078 commit 8f29c91
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions helix-term/src/commands/typed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ fn force_quit(

ensure!(args.is_empty(), ":quit! takes no arguments");

cx.block_try_flush_writes()?;
cx.editor.close(view!(cx.editor).id);

Ok(())
Expand Down

0 comments on commit 8f29c91

Please sign in to comment.