fix handling empty files

This commit is contained in:
alice pellerin
2026-03-18 19:18:08 -05:00
parent 0a98df9000
commit a699c0a371
6 changed files with 59 additions and 37 deletions
+1 -1
View File
@@ -66,7 +66,7 @@ impl App {
fn delete_at(&mut self, cursor: Cursor) {
self.contents.drain(cursor.range());
self.cursor.head = min(min(cursor.head, cursor.tail), self.contents.len() - 1);
self.cursor.head = min(min(cursor.head, cursor.tail), self.max_contents_index());
self.cursor.collapse();
}