chat: guard pop_line against empty list
Small defensive improvement - only pop markers and invalidate scroll if lines.pop() actually removed something. Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
parent
f06c8077e1
commit
195abfaab1
1 changed files with 4 additions and 3 deletions
|
|
@ -368,9 +368,10 @@ impl PaneState {
|
|||
}
|
||||
|
||||
fn pop_line(&mut self) {
|
||||
self.lines.pop();
|
||||
self.markers.pop();
|
||||
self.scroll.invalidate_from(self.lines.len());
|
||||
if self.lines.pop().is_some() {
|
||||
self.markers.pop();
|
||||
self.scroll.invalidate_from(self.lines.len());
|
||||
}
|
||||
}
|
||||
|
||||
fn scroll_up(&mut self, n: u16) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue