summaryrefslogtreecommitdiff
path: root/src/state/editor/buffer.rs
diff options
context:
space:
mode:
authorNathan Reiner <nathan@nathanreiner.xyz>2024-08-02 21:18:29 +0200
committerNathan Reiner <nathan@nathanreiner.xyz>2024-08-02 21:18:29 +0200
commit665eecff57a0a5f9ccb225d3781f6ecdc7637920 (patch)
tree8ef3d599675f6464e58c4c2e0e0eb54382efcbae /src/state/editor/buffer.rs
parent219c560c7c0ad9e3960298ec125d4e64637fe84b (diff)
fix editor deletion overflow issue
Diffstat (limited to 'src/state/editor/buffer.rs')
-rw-r--r--src/state/editor/buffer.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/state/editor/buffer.rs b/src/state/editor/buffer.rs
index fa26eb7..49c27b9 100644
--- a/src/state/editor/buffer.rs
+++ b/src/state/editor/buffer.rs
@@ -108,7 +108,7 @@ impl Buffer {
.move_checked(CursorMove::Jump((new_x, self.cursor.y())));
self.refresh_buffer_max()
- } else {
+ } else if !self.cursor.is_at_top() {
let x = self.cursor.x() - 1;
self.current_line_mut().remove(x);
self.refresh_line_max();