Skip to content

Commit

Permalink
fix(grid): fix DL/IL being ineffective without scrolling region (#3382)
Browse files Browse the repository at this point in the history
  • Loading branch information
akinomyoga authored May 27, 2024
1 parent 5f5d6df commit 3188e69
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions zellij-server/src/panes/grid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2752,13 +2752,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();
Expand Down

0 comments on commit 3188e69

Please sign in to comment.