summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Manuel Tomás <jtomas1815@gmail.com>2020-04-21 10:50:31 -0300
committerJuan Manuel Tomás <jtomas1815@gmail.com>2020-04-21 10:50:31 -0300
commit5a0a868a61423fa395a89b49471d5451a5ed2c71 (patch)
tree71ca2476ba5a852de8945dfc0876682bf64936fe
parent9305bb601755e84ff91b79a490be00e0d654251b (diff)
downloadjet-5a0a868a61423fa395a89b49471d5451a5ed2c71.tar.gz
jet-5a0a868a61423fa395a89b49471d5451a5ed2c71.zip
Fix point not updating after insert and delete
-rw-r--r--page.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/page.c b/page.c
index e2a122d..09bf860 100644
--- a/page.c
+++ b/page.c
@@ -121,6 +121,7 @@ void insert_at_point(struct point *point, uint8_t c) {
page->buffer[page->gap_start] = c;
page->gap_start++;
page->element_count++;
+ move_point_forward(point);
}
void delete_at_point(struct point *point) {
@@ -142,6 +143,7 @@ void delete_at_point(struct point *point) {
if (page->gap_start != 0) {
page->gap_start--;
page->element_count--;
+ move_point_backward(point);
}
}