fix insert

This commit is contained in:
rick 2023-04-23 17:42:28 +02:00
parent 916360671a
commit fde859a48a
Signed by: Rick
GPG key ID: 5CBE8779CD27BCBA

View file

@ -73,8 +73,8 @@ impl Buffer {
self.has_changed = true;
match addr {
Address::Actual | Address::Empty => self.insert_buffer(self.current_line, lines),
Address::Line(l) => self.insert_buffer(l, lines),
Address::Last => self.insert_buffer(self.buffer.len(), lines),
Address::Line(l) => self.insert_buffer(l.saturating_sub(1), lines),
Address::Last => self.insert_buffer(self.buffer.len().saturating_sub(1), lines),
_ => (),
}
}