Fix out of bounds issue when using the Delete key

Signed-off-by: AnErrupTion <anerruption@disroot.org>
This commit is contained in:
AnErrupTion 2024-05-03 20:59:30 +02:00
parent 5a9cc881fe
commit 629749b383
No known key found for this signature in database
GPG Key ID: 3E85EB44F610AD7F
1 changed files with 2 additions and 0 deletions

View File

@ -118,6 +118,8 @@ fn goRight(self: *Text) void {
}
fn delete(self: *Text) void {
if (self.cursor >= self.end) return;
_ = self.text.orderedRemove(self.cursor);
self.end -= 1;