Skip to main content

vtcode_tui/core_tui/session/
impl_scroll.rs

1use super::*;
2
3impl Session {
4    pub fn scroll_offset(&self) -> usize {
5        self.scroll_manager.offset()
6    }
7
8    #[allow(dead_code)]
9    pub(super) fn scroll_to_top(&mut self) {
10        self.mark_scrolling();
11        // Inverted model: max offset = top of content
12        self.scroll_manager.scroll_to_bottom();
13        self.user_scrolled = true;
14        self.mark_dirty();
15    }
16
17    #[allow(dead_code)]
18    pub(super) fn scroll_to_bottom(&mut self) {
19        self.mark_scrolling();
20        // Inverted model: offset 0 = bottom of content
21        self.scroll_manager.scroll_to_top();
22        self.user_scrolled = false;
23        self.mark_dirty();
24    }
25}