aboutsummaryrefslogtreecommitdiffstats
path: root/default-plugins/layout-manager/src/ui/multi_line_error_message.rs
diff options
context:
space:
mode:
authorAram Drevekenin <aram@poor.dev>2026-01-13 11:27:07 +0100
committerGitHub <noreply@github.com>2026-01-13 11:27:07 +0100
commit4a27ceea0d99b036ca607e05714cef15689d7c26 (patch)
tree22c0148718a82082bdb196c5e867697f514cc541 /default-plugins/layout-manager/src/ui/multi_line_error_message.rs
parentdocs(CONTRIBUTING): Describe rust toolchain versioning policy (#4585) (diff)
downloadsl0ppij-4a27ceea0d99b036ca607e05714cef15689d7c26.tar.gz
sl0ppij-4a27ceea0d99b036ca607e05714cef15689d7c26.tar.xz
sl0ppij-4a27ceea0d99b036ca607e05714cef15689d7c26.zip
Layout manager (#4601)
* ad plugin override_layout command * watch available layouts and report to plugin thread * Event::AvailableLayoutInfo * save layout command * refactor save_layout * fix api and permissions * delete_layout API command * edit layout in place API * edit layout response through api * propagate layout parsing errors * generate random name plugin api * dump stringified layout API * synchronicity dump_session_layout and include LayoutMetadata in sync response * parse_layout plugin api * fix: default to default layout dir in plugin api * rename_layout plugin command API * initial implementation of multi-tab override * apply to multiple tabs * allow applying to only the active tab * add tab/pane names to layout parsing metadata * indicate is_builtin_plugin in PaneMetadata * get_layout_dir plugin API command * consolidate (and fix) is_builtin_plugin logic * fix bad ret * allow dumping the layout for just a specific tab in the session * get focused pane and tab sync api * color last substring variants * add plugin * update assets * fix tests * add e2e tests for new plugin apis * update ui with new shortcut * rustfmt * docs(changelog): add PR
Diffstat (limited to 'default-plugins/layout-manager/src/ui/multi_line_error_message.rs')
-rw-r--r--default-plugins/layout-manager/src/ui/multi_line_error_message.rs26
1 files changed, 26 insertions, 0 deletions
diff --git a/default-plugins/layout-manager/src/ui/multi_line_error_message.rs b/default-plugins/layout-manager/src/ui/multi_line_error_message.rs
new file mode 100644
index 00000000..223d7de3
--- /dev/null
+++ b/default-plugins/layout-manager/src/ui/multi_line_error_message.rs
@@ -0,0 +1,26 @@
+use zellij_tile::prelude::*;
+
+pub struct MultiLineErrorMessage {
+ message: Vec<String>,
+}
+
+impl MultiLineErrorMessage {
+ pub fn new(message: Vec<String>) -> Self {
+ Self { message }
+ }
+
+ pub fn render(&self, x: usize, y: usize, max_rows: usize) {
+ let title = Text::new("Error").error_color_all();
+ print_text_with_coordinates(title, x, y, None, None);
+
+ let mut current_y = y + 2;
+ for line in self.message.iter().take(max_rows) {
+ let text = Text::new(line).error_color_all();
+ print_text_with_coordinates(text, x, current_y, None, None);
+ current_y += 1;
+ }
+
+ let help = Text::new("Press any key to continue");
+ print_text_with_coordinates(help, x, current_y + 2, None, None);
+ }
+}