From 5392bbb3ded81d91c4f66f9c3bfdd4e588242e62 Mon Sep 17 00:00:00 2001 From: Fabrice Date: Mon, 2 Mar 2026 22:04:59 +0100 Subject: adds cursor to buffer --- src/source.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') 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(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; -- cgit v1.2.3