aboutsummaryrefslogtreecommitdiffstats
path: root/src/client
diff options
context:
space:
mode:
authorAram Drevekenin <aram@poor.dev>2021-04-14 14:08:46 +0200
committerGitHub <noreply@github.com>2021-04-14 14:08:46 +0200
commitf9fe1856f209412d67d157036235cc7ced2aec15 (patch)
treef3441aff87488bfd94771e8fb6e5b633ee77b6c3 /src/client
parentfix(terminal): persiste vte state (#269) (diff)
downloadsl0ppij-f9fe1856f209412d67d157036235cc7ced2aec15.tar.gz
sl0ppij-f9fe1856f209412d67d157036235cc7ced2aec15.tar.xz
sl0ppij-f9fe1856f209412d67d157036235cc7ced2aec15.zip
fix(compatibility): rotate scroll region (#270)
Diffstat (limited to 'src/client')
-rw-r--r--src/client/panes/grid.rs22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/client/panes/grid.rs b/src/client/panes/grid.rs
index 86dc4753..89466bea 100644
--- a/src/client/panes/grid.rs
+++ b/src/client/panes/grid.rs
@@ -447,11 +447,25 @@ impl Grid {
self.scroll_down_one_line();
}
}
- pub fn rotate_scroll_region_up(&mut self, _count: usize) {
- // TBD
+ pub fn rotate_scroll_region_up(&mut self, count: usize) {
+ if let Some((scroll_region_top, scroll_region_bottom)) = self.scroll_region {
+ for _ in 0..count {
+ let columns = vec![EMPTY_TERMINAL_CHARACTER; self.width];
+ self.viewport.remove(scroll_region_bottom);
+ self.viewport
+ .insert(scroll_region_top, Row::from_columns(columns).canonical());
+ }
+ }
}
- pub fn rotate_scroll_region_down(&mut self, _count: usize) {
- // TBD
+ pub fn rotate_scroll_region_down(&mut self, count: usize) {
+ if let Some((scroll_region_top, scroll_region_bottom)) = self.scroll_region {
+ for _ in 0..count {
+ let columns = vec![EMPTY_TERMINAL_CHARACTER; self.width];
+ self.viewport.remove(scroll_region_top);
+ self.viewport
+ .insert(scroll_region_bottom, Row::from_columns(columns).canonical());
+ }
+ }
}
pub fn add_canonical_line(&mut self) {
if let Some((scroll_region_top, scroll_region_bottom)) = self.scroll_region {