fix(scroll): scroll page up/down by actual amount of rows (#1025)

use pane content_rows to take account of frame enabled/disabled
This commit is contained in:
Thomas Linford 2022-01-26 18:19:38 +01:00 committed by GitHub
parent bbffbecdef
commit a576b3150f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1722,7 +1722,7 @@ impl Tab {
.get_mut(&PaneId::Terminal(active_terminal_id)) .get_mut(&PaneId::Terminal(active_terminal_id))
.unwrap(); .unwrap();
// prevent overflow when row == 0 // prevent overflow when row == 0
let scroll_rows = active_terminal.rows().max(1) - 1; let scroll_rows = active_terminal.get_content_rows();
active_terminal.scroll_up(scroll_rows, client_id); active_terminal.scroll_up(scroll_rows, client_id);
} }
} }
@ -1733,7 +1733,7 @@ impl Tab {
.get_mut(&PaneId::Terminal(active_terminal_id)) .get_mut(&PaneId::Terminal(active_terminal_id))
.unwrap(); .unwrap();
// prevent overflow when row == 0 // prevent overflow when row == 0
let scroll_rows = active_terminal.rows().max(1) - 1; let scroll_rows = active_terminal.get_content_rows();
active_terminal.scroll_down(scroll_rows, client_id); active_terminal.scroll_down(scroll_rows, client_id);
if !active_terminal.is_scrolled() { if !active_terminal.is_scrolled() {
self.process_pending_vte_events(active_terminal_id); self.process_pending_vte_events(active_terminal_id);