From 5c4469ffa7727b7a8d82f3f8261613a30591b4de Mon Sep 17 00:00:00 2001 From: Alexandru Placinta Date: Sun, 11 Feb 2024 23:53:57 +0100 Subject: [PATCH] Fix row indexing with inclusive ranges --- alacritty_terminal/src/grid/row.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alacritty_terminal/src/grid/row.rs b/alacritty_terminal/src/grid/row.rs index 951ef093..4e22e50b 100644 --- a/alacritty_terminal/src/grid/row.rs +++ b/alacritty_terminal/src/grid/row.rs @@ -291,7 +291,7 @@ impl Index> for Row { impl IndexMut> for Row { #[inline] fn index_mut(&mut self, index: RangeToInclusive) -> &mut [T] { - self.occ = max(self.occ, *index.end); + self.occ = max(self.occ, *index.end + 1); &mut self.inner[..=(index.end.0)] } }