diff options
author | Aram Drevekenin <aram@poor.dev> | 2023-04-19 10:09:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-19 10:09:39 +0200 |
commit | caaee30179cf8e3d20ad103b898e4bad9ebf648b (patch) | |
tree | 6348896d80031befd553d71340e99c02f8f0d078 /zellij-server/src/panes | |
parent | 26fcf8470295f0ce37f70d0f7bdd557296f88539 (diff) |
feat(plugins): reload plugin at runtime (#2372)
* fix(plugins): proper error when wasm file does not exist
* reload working
* race condition handling
* refactor(plugins): start plugin
* refactor(plugins): plugin-loader
* refactor(plugins): load/reload plugin
* refactor(plugins): apply cached events
* fix(plugins): gittery loading
* chore(plugins): rename reload-plugin to start-or-reload-plugin
* chore(styling): small cleanups
* style(fmt): rustfmt
* style(fmt): cleanups
* style(fmt): cleanups
* test(e2e): update snapshots
* test(e2e): update snapshots
* chore(repo): comment plugin optimization because it doubles the CI time
Diffstat (limited to 'zellij-server/src/panes')
-rw-r--r-- | zellij-server/src/panes/grid.rs | 4 | ||||
-rw-r--r-- | zellij-server/src/panes/plugin_pane.rs | 6 |
2 files changed, 8 insertions, 2 deletions
diff --git a/zellij-server/src/panes/grid.rs b/zellij-server/src/panes/grid.rs index b76d21ecb..6f44f6eb4 100644 --- a/zellij-server/src/panes/grid.rs +++ b/zellij-server/src/panes/grid.rs @@ -1254,7 +1254,7 @@ impl Grid { let new_row = Row::new(self.width).canonical(); self.viewport.push(new_row); } - if self.cursor.y == self.height - 1 { + if self.cursor.y == self.height.saturating_sub(1) { if self.scroll_region.is_none() { if self.alternate_screen_state.is_none() { self.transfer_rows_to_lines_above(1); @@ -1406,7 +1406,7 @@ impl Grid { } fn line_wrap(&mut self) { self.cursor.x = 0; - if self.cursor.y == self.height - 1 { + if self.cursor.y == self.height.saturating_sub(1) { if self.alternate_screen_state.is_none() { self.transfer_rows_to_lines_above(1); } else { diff --git a/zellij-server/src/panes/plugin_pane.rs b/zellij-server/src/panes/plugin_pane.rs index 8a45c3c10..7915069c5 100644 --- a/zellij-server/src/panes/plugin_pane.rs +++ b/zellij-server/src/panes/plugin_pane.rs @@ -545,6 +545,12 @@ impl Pane for PluginPane { self.loading_indication.to_string().as_bytes().to_vec(), ); } + fn start_loading_indication(&mut self, loading_indication: LoadingIndication) { + self.loading_indication.merge(loading_indication); + self.handle_plugin_bytes_for_all_clients( + self.loading_indication.to_string().as_bytes().to_vec(), + ); + } fn progress_animation_offset(&mut self) { if self.loading_indication.ended { return; |