fix(compatibility): rotate scroll region (#270)

This commit is contained in:
Aram Drevekenin 2021-04-14 14:08:46 +02:00 committed by GitHub
parent ceb2ebbd2b
commit f9fe1856f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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) {
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 rotate_scroll_region_down(&mut self, _count: usize) {
// TBD
}
pub fn add_canonical_line(&mut self) {
if let Some((scroll_region_top, scroll_region_bottom)) = self.scroll_region {