summaryrefslogtreecommitdiffstats
path: root/zellij-server/src/background_jobs.rs
diff options
context:
space:
mode:
authorAram Drevekenin <aram@poor.dev>2022-12-19 12:48:43 +0100
committerGitHub <noreply@github.com>2022-12-19 12:48:43 +0100
commit1b5f3c52a48feb584228f326c20829c83c21cc47 (patch)
treef4a76f6ecb2e3fca72c83899ba2c1cd83acbfe02 /zellij-server/src/background_jobs.rs
parentd1f50150f6f7525f93ccb9ed94f75ce6bfb5c60b (diff)
fix(panes): show visual error when failing to resize panes (#2036)
* fix(panes): show visual error when failing to resize pane vertically/horizontally * fix(resize): retry pane resize on rounding errors * fix(resize): proper error when resizing other panes into fixed panes * style(fmt): rustfmt
Diffstat (limited to 'zellij-server/src/background_jobs.rs')
-rw-r--r--zellij-server/src/background_jobs.rs11
1 files changed, 7 insertions, 4 deletions
diff --git a/zellij-server/src/background_jobs.rs b/zellij-server/src/background_jobs.rs
index 3c89ed064..c612c9d57 100644
--- a/zellij-server/src/background_jobs.rs
+++ b/zellij-server/src/background_jobs.rs
@@ -10,7 +10,7 @@ use crate::thread_bus::Bus;
#[derive(Debug, Clone, Eq, PartialEq, Hash)]
pub enum BackgroundJob {
- DisplayPaneError(PaneId, String),
+ DisplayPaneError(Vec<PaneId>, String),
Exit,
}
@@ -34,7 +34,7 @@ pub(crate) fn background_jobs_main(bus: Bus<BackgroundJob>) -> Result<()> {
err_ctx.add_call(ContextType::BackgroundJob((&event).into()));
let job = event.clone();
match event {
- BackgroundJob::DisplayPaneError(pane_id, text) => {
+ BackgroundJob::DisplayPaneError(pane_ids, text) => {
if job_already_running(job, &mut running_jobs) {
continue;
}
@@ -42,11 +42,14 @@ pub(crate) fn background_jobs_main(bus: Bus<BackgroundJob>) -> Result<()> {
let senders = bus.senders.clone();
async move {
let _ = senders.send_to_screen(
- ScreenInstruction::AddRedPaneFrameColorOverride(pane_id, Some(text)),
+ ScreenInstruction::AddRedPaneFrameColorOverride(
+ pane_ids.clone(),
+ Some(text),
+ ),
);
task::sleep(std::time::Duration::from_millis(FLASH_DURATION_MS)).await;
let _ = senders.send_to_screen(
- ScreenInstruction::ClearPaneFrameColorOverride(pane_id),
+ ScreenInstruction::ClearPaneFrameColorOverride(pane_ids),
);
}
});