aboutsummaryrefslogtreecommitdiff
path: root/src/grid
diff options
context:
space:
mode:
authorChristian Duerr <contact@christianduerr.com>2018-05-02 20:49:32 +0200
committerJoe Wilm <joe@jwilm.com>2018-06-02 09:56:50 -0700
commit6cddceb6cde032a79253f0596850c3e3c1c66db7 (patch)
treeb260fdbd3a35e7656d5337a957e7b180a4d53280 /src/grid
parenteabd6bb95b1ab883bdec16f8c307432c1e7c73d5 (diff)
downloadalacritty-6cddceb6cde032a79253f0596850c3e3c1c66db7.tar.gz
alacritty-6cddceb6cde032a79253f0596850c3e3c1c66db7.zip
Add documentation for `len` field on `Storage`
Because the purpose of the `len` field wasn't obvious and collided with other uses (like Vec::len()), some additional documentation has added to make things a little easier to understand.
Diffstat (limited to 'src/grid')
-rw-r--r--src/grid/storage.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/grid/storage.rs b/src/grid/storage.rs
index 1f71b5b5..f59b01b7 100644
--- a/src/grid/storage.rs
+++ b/src/grid/storage.rs
@@ -20,6 +20,13 @@ pub struct Storage<T> {
inner: Vec<T>,
zero: usize,
visible_lines: Line,
+
+ /// Total number of lines currently active in the terminal (scrollback + visible)
+ ///
+ /// Shrinking this length allows reducing the number of lines in the scrollback buffer without
+ /// having to truncate the raw `inner` buffer.
+ /// As long as `len` is bigger than `inner`, it is also possible to grow the scrollback buffer
+ /// without any additional insertions.
#[serde(skip)]
len: usize,
}