From a8d3f0321677bbda7470985f1579c39e4c4d330c Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Mon, 27 May 2024 21:33:05 +0900 Subject: [PATCH] fix(grid): fix DL/IL being ineffective without scrolling region --- zellij-server/src/panes/grid.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/zellij-server/src/panes/grid.rs b/zellij-server/src/panes/grid.rs index 3109cb10f4..9e928cd694 100644 --- a/zellij-server/src/panes/grid.rs +++ b/zellij-server/src/panes/grid.rs @@ -2740,13 +2740,21 @@ impl Perform for Grid { self.clear_scroll_region(); } } else if c == 'M' { - // delete lines if currently inside scroll region + // delete lines if currently inside scroll region, or otherwise + // delete lines in the entire viewport + if self.scroll_region.is_none() { + self.set_scroll_region_to_viewport_size(); + } let line_count_to_delete = next_param_or(1); let mut pad_character = EMPTY_TERMINAL_CHARACTER; pad_character.styles = self.cursor.pending_styles.clone(); self.delete_lines_in_scroll_region(line_count_to_delete, pad_character); } else if c == 'L' { - // insert blank lines if inside scroll region + // insert blank lines if inside scroll region, or otherwise insert + // blank lines in the entire viewport + if self.scroll_region.is_none() { + self.set_scroll_region_to_viewport_size(); + } let line_count_to_add = next_param_or(1); let mut pad_character = EMPTY_TERMINAL_CHARACTER; pad_character.styles = self.cursor.pending_styles.clone();