summaryrefslogtreecommitdiff
path: root/point.c
diff options
context:
space:
mode:
authorJuan Manuel Tomás <jtomas1815@gmail.com>2020-04-27 10:09:52 -0300
committerJuan Manuel Tomás <jtomas1815@gmail.com>2020-04-27 10:09:52 -0300
commita8b879b9e91d29eb8d3172a445b7501ffd3a83c2 (patch)
treee6fffe37fb3fefd3a86cf2957f23f2c940e25852 /point.c
parent85b84f23d22a84f9961a66beed99df489478dd86 (diff)
downloadjet-a8b879b9e91d29eb8d3172a445b7501ffd3a83c2.tar.gz
jet-a8b879b9e91d29eb8d3172a445b7501ffd3a83c2.zip
Add basic editing capabilities
Cursor is now visible and can insert, delete and move across the buffer.
Diffstat (limited to 'point.c')
-rw-r--r--point.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/point.c b/point.c
index 23ce492..8ef0c41 100644
--- a/point.c
+++ b/point.c
@@ -22,6 +22,10 @@ uint8_t element(struct point *point) {
}
}
+bool same_location(struct point *a, struct point *b) {
+ return a->page == b->page && a->index == b->index;
+}
+
bool at_eof(struct point *point) {
return point->index == point->page->element_count && !point->page->next;
}