diff options
Diffstat (limited to 'src/grid/mod.rs')
-rw-r--r-- | src/grid/mod.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/grid/mod.rs b/src/grid/mod.rs index b6313751..113445af 100644 --- a/src/grid/mod.rs +++ b/src/grid/mod.rs @@ -435,6 +435,20 @@ impl<T> Grid<T> { self.raw.len() } + #[inline] + pub fn history_size(&self) -> usize { + self.raw.len().saturating_sub(*self.lines) + } + + /// This is used only for initializing after loading ref-tests + pub fn initialize_all(&mut self, template: &T) + where + T: Copy + { + let history_size = self.raw.len().saturating_sub(*self.lines); + self.raw.initialize(self.max_scroll_limit - history_size, Row::new(self.cols, template)); + } + /// This is used only for truncating before saving ref-tests pub fn truncate(&mut self) { self.raw.truncate(); |