diff options
author | Joe Wilm <joe@jwilm.com> | 2016-09-16 17:12:53 -0700 |
---|---|---|
committer | Joe Wilm <joe@jwilm.com> | 2016-09-16 17:12:53 -0700 |
commit | 7da9de34d81f6a03f1923ff95ce0f48678ce86fb (patch) | |
tree | b61a9412acb549e1b6dffd50c98e064410e5bce1 /src/grid.rs | |
parent | c5bc39fe263466986aff622d26d5c93f2f5da0ff (diff) | |
download | r-alacritty-7da9de34d81f6a03f1923ff95ce0f48678ce86fb.tar.gz r-alacritty-7da9de34d81f6a03f1923ff95ce0f48678ce86fb.tar.bz2 r-alacritty-7da9de34d81f6a03f1923ff95ce0f48678ce86fb.zip |
Fix crash
There might be a better way to track cursor state such that these checks
aren't necessary.
Diffstat (limited to 'src/grid.rs')
-rw-r--r-- | src/grid.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/grid.rs b/src/grid.rs index d62903c9..c3473d8c 100644 --- a/src/grid.rs +++ b/src/grid.rs @@ -134,6 +134,10 @@ impl<T> Grid<T> { } } + pub fn contains(&self, cursor: &Cursor) -> bool { + self.lines > cursor.line && self.cols > cursor.col + } + /// Swap two lines in the grid /// /// This could have used slice::swap internally, but we are able to have |