MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / log_autoscroll_offset

Method log_autoscroll_offset

crates/openshell-tui/src/app.rs:2731–2740  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

2729 }
2730
2731 pub fn log_autoscroll_offset(&self) -> usize {
2732 const BOTTOM_PAD: usize = 3;
2733 let filtered_len = self.filtered_log_lines().len();
2734 let vh = self.log_viewport_height;
2735 if vh == 0 || filtered_len == 0 {
2736 return 0;
2737 }
2738 let usable = vh.saturating_sub(BOTTOM_PAD);
2739 filtered_len.saturating_sub(usable)
2740 }
2741
2742 /// Cancel any running log stream task.
2743 pub fn cancel_log_stream(&mut self) {

Callers 3

runFunction · 0.80
handle_logs_keyMethod · 0.80
scroll_logsMethod · 0.80

Calls 2

lenMethod · 0.80
filtered_log_linesMethod · 0.80

Tested by

no test coverage detected