summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabrice <fabrice@schaub-dev.xyz>2026-03-02 22:04:59 +0100
committerFabrice <fabrice@schaub-dev.xyz>2026-03-02 22:04:59 +0100
commit5392bbb3ded81d91c4f66f9c3bfdd4e588242e62 (patch)
tree2820b43f309848d944a63876f959150db85c219f
parentf291e0418202c48438407a30de9040ea4f0b4211 (diff)
adds cursor to buffer
-rw-r--r--src/source.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/source.cc b/src/source.cc
index e1a0710..efa15e8 100644
--- a/src/source.cc
+++ b/src/source.cc
@@ -19,6 +19,7 @@ struct Buffer {
String content;
Link link;
const Allocator* allocator;
+ usize cursor;
};
bool buffer_init(const Allocator* allocator,
@@ -30,6 +31,7 @@ bool buffer_init(const Allocator* allocator,
Buffer* buffer = allocate<Buffer>(allocator, 1);
if(buffer == nullptr) return false;
+ memset(buffer, 0, sizeof(*buffer));
String content, file;
bool ret = slice_copy(allocator, content_in, &content);
@@ -48,7 +50,6 @@ bool buffer_init(const Allocator* allocator,
buffer->file = file;
buffer->content = content;
buffer->allocator = allocator;
- buffer->link = {};
*out = buffer;
return true;