diff --git a/zellij-server/src/plugins/plugin_loader.rs b/zellij-server/src/plugins/plugin_loader.rs index 602b2c4b..39cb4362 100644 --- a/zellij-server/src/plugins/plugin_loader.rs +++ b/zellij-server/src/plugins/plugin_loader.rs @@ -507,6 +507,7 @@ impl<'a> PluginLoader<'a> { Ok(module) } pub fn compile_module(&mut self) -> Result { + self.loading_indication.override_previous_error(); display_loading_stage!( indicate_loading_plugin_from_hd_cache_notfound, self.loading_indication, diff --git a/zellij-server/src/plugins/wasm_bridge.rs b/zellij-server/src/plugins/wasm_bridge.rs index 5b7761f1..bb58d611 100644 --- a/zellij-server/src/plugins/wasm_bridge.rs +++ b/zellij-server/src/plugins/wasm_bridge.rs @@ -927,5 +927,4 @@ pub fn handle_plugin_crash(plugin_id: PluginId, message: String, senders: Thread plugin_id, loading_indication, )); - let _ = senders.send_to_plugin(PluginInstruction::Unload(plugin_id)); } diff --git a/zellij-server/src/ui/loading_indication.rs b/zellij-server/src/ui/loading_indication.rs index 1aa514ec..1026c8ae 100644 --- a/zellij-server/src/ui/loading_indication.rs +++ b/zellij-server/src/ui/loading_indication.rs @@ -25,6 +25,7 @@ pub struct LoadingIndication { animation_offset: usize, plugin_name: String, terminal_emulator_colors: Option, + override_previous_error: bool, } impl LoadingIndication { @@ -46,13 +47,16 @@ impl LoadingIndication { let current_animation_offset = self.animation_offset; let current_terminal_emulator_colors = self.terminal_emulator_colors.take(); let mut current_error = self.error.take(); + let override_previous_error = other.override_previous_error; drop(std::mem::replace(self, other)); self.animation_offset = current_animation_offset; self.terminal_emulator_colors = current_terminal_emulator_colors; if let Some(current_error) = current_error.take() { // we do this so that only the first error (usually the root cause) will be shown // when plugins support scrolling, we might want to do an append here - self.error = Some(current_error); + if !override_previous_error { + self.error = Some(current_error); + } } } pub fn indicate_loading_plugin_from_memory(&mut self) { @@ -113,6 +117,9 @@ impl LoadingIndication { pub fn is_error(&self) -> bool { self.error.is_some() } + pub fn override_previous_error(&mut self) { + self.override_previous_error = true; + } fn started_loading(&self) -> bool { self.loading_from_memory.is_some() || self.loading_from_hd_cache.is_some()