From a8b879b9e91d29eb8d3172a445b7501ffd3a83c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Manuel=20Tom=C3=A1s?= Date: Mon, 27 Apr 2020 10:09:52 -0300 Subject: Add basic editing capabilities Cursor is now visible and can insert, delete and move across the buffer. --- point.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'point.c') 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; } -- cgit v1.2.3