diff options
author | Christian Duerr <contact@christianduerr.com> | 2018-05-02 20:49:32 +0200 |
---|---|---|
committer | Joe Wilm <jwilm@users.noreply.github.com> | 2018-05-29 21:00:21 -0700 |
commit | 973c30eb50f720d02c63ffa1f23f44d801eb79d1 (patch) | |
tree | 3794d906042ccf4e3ba8647211fdbcb2de6ca742 | |
parent | 47ae118e6d009e021620f58ac51ad0e34df0b73b (diff) | |
download | alacritty-973c30eb50f720d02c63ffa1f23f44d801eb79d1.tar.gz alacritty-973c30eb50f720d02c63ffa1f23f44d801eb79d1.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.
-rw-r--r-- | src/grid/storage.rs | 7 |
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, } |