diff options
author | Yves Biener <56591091+yves-biener@users.noreply.github.com> | 2023-01-24 13:51:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-24 21:51:11 +0900 |
commit | 650aeb12bed057572cb806e9324647dd35a05e98 (patch) | |
tree | 5da0d6d5176f2a9f457c630167d7eb11864c4d8c /zellij-server/src/tab | |
parent | beddfb77a8ef8a5b90db084ad8030d1168f77352 (diff) |
feat: add ScrollToTop action (#2110)
Diffstat (limited to 'zellij-server/src/tab')
-rw-r--r-- | zellij-server/src/tab/mod.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/zellij-server/src/tab/mod.rs b/zellij-server/src/tab/mod.rs index 093237eae..0dcd7ba58 100644 --- a/zellij-server/src/tab/mod.rs +++ b/zellij-server/src/tab/mod.rs @@ -2046,6 +2046,16 @@ impl Tab { Ok(()) } + pub fn scroll_active_terminal_to_top(&mut self, client_id: ClientId) -> Result<()> { + if let Some(active_pane) = self.get_active_pane_or_floating_pane_mut(client_id) { + active_pane.clear_scroll(); + if let Some(size) = active_pane.get_line_number() { + active_pane.scroll_up(size, client_id); + } + } + Ok(()) + } + pub fn clear_active_terminal_scroll(&mut self, client_id: ClientId) -> Result<()> { // TODO: is this a thing? let err_context = |