Struct alacritty_terminal::grid::Grid
source ·
[−]Expand description
Grid based terminal content storage.
┌─────────────────────────┐ <-- max_scroll_limit + lines
│ │
│ UNINITIALIZED │
│ │
├─────────────────────────┤ <-- self.raw.inner.len()
│ │
│ RESIZE BUFFER │
│ │
├─────────────────────────┤ <-- self.history_size() + lines
│ │
│ SCROLLUP REGION │
│ │
├─────────────────────────┤v lines
│ │|
│ VISIBLE REGION │|
│ │|
├─────────────────────────┤^ <-- display_offset
│ │
│ SCROLLDOWN REGION │
│ │
└─────────────────────────┘ <-- zero
^
columns
Fields
cursor: Cursor<T>
Current cursor for writing data.
saved_cursor: Cursor<T>
Last saved cursor.
Implementations
Update the size of the scrollback history.
pub fn scroll_down<D>(&mut self, region: &Range<Line>, positions: usize) where
T: ResetDiscriminant<D>,
D: PartialEq,
Move lines at the bottom toward the top.
This is the performance-sensitive part of scrolling.
Completely reset the grid state.
pub fn reset_region<D, R: RangeBounds<Line>>(&mut self, bounds: R) where
T: ResetDiscriminant<D> + GridCell + Clone + Default,
D: PartialEq,
pub fn reset_region<D, R: RangeBounds<Line>>(&mut self, bounds: R) where
T: ResetDiscriminant<D> + GridCell + Clone + Default,
D: PartialEq,
Reset a visible region within the grid.
This is used only for initializing after loading ref-tests.
pub fn iter_from(&self, point: Point) -> GridIterator<'_, T>ⓘNotable traits for GridIterator<'a, T>impl<'a, T> Iterator for GridIterator<'a, T> type Item = Indexed<&'a T>;
pub fn iter_from(&self, point: Point) -> GridIterator<'_, T>ⓘNotable traits for GridIterator<'a, T>impl<'a, T> Iterator for GridIterator<'a, T> type Item = Indexed<&'a T>;
impl<'a, T> Iterator for GridIterator<'a, T> type Item = Indexed<&'a T>;
Iterate over all cells in the grid starting at a specific point.
pub fn display_iter(&self) -> GridIterator<'_, T>ⓘNotable traits for GridIterator<'a, T>impl<'a, T> Iterator for GridIterator<'a, T> type Item = Indexed<&'a T>;
pub fn display_iter(&self) -> GridIterator<'_, T>ⓘNotable traits for GridIterator<'a, T>impl<'a, T> Iterator for GridIterator<'a, T> type Item = Indexed<&'a T>;
impl<'a, T> Iterator for GridIterator<'a, T> type Item = Indexed<&'a T>;
Iterate over all visible cells.
This is slightly more optimized than calling Grid::iter_from
in combination with
Iterator::take_while
.
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Total number of lines in the buffer, this includes scrollback and visible lines.
Height of the viewport in lines.
Index for the last column.
Line farthest up in the grid history.
Line farthest down in the grid history.
Number of invisible lines part of the scrollback history.
Auto Trait Implementations
impl<T> RefUnwindSafe for Grid<T> where
T: RefUnwindSafe,
impl<T> UnwindSafe for Grid<T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more