Skip to content

Commit

Permalink
Don't panic when the serial and parallel send loops exit in the wrong…
Browse files Browse the repository at this point in the history
… order
  • Loading branch information
fredizzimo committed Oct 12, 2023
1 parent 60a6c1b commit c3e9ec4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/bridge/ui_commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,10 @@ pub fn start_ui_command_handler(nvim: Arc<Neovim<NeovimWriter>>) {
let mut ui_command_receiver = EVENT_AGGREGATOR.register_event::<UiCommand>();
while RUNNING_TRACKER.is_running() {
match ui_command_receiver.recv().await {
Some(UiCommand::Serial(serial_command)) => serial_tx
.send(serial_command)
.expect("Could not send serial ui command"),
Some(UiCommand::Serial(serial_command)) => {
// This can fail if the serial_rx loop exits before this one, so ignore the errors
let _ = serial_tx.send(serial_command);
}
Some(UiCommand::Parallel(parallel_command)) => {
let ui_command_nvim = ui_command_nvim.clone();
tokio::spawn(async move {
Expand Down

0 comments on commit c3e9ec4

Please sign in to comment.