summaryrefslogtreecommitdiff
path: root/buffer.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-01-18 20:54:07 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2021-01-18 20:54:07 -0500
commit8a4984e0e15fcfb0be6db242ab3f60325b80abd8 (patch)
treeb71eb3ec8e715164a9347cb6ce7d6d83298309d0 /buffer.c
parent530001a433c847b40d109d08cd8ff0958efdca1c (diff)
bug fixes, narrow file list based on search term
Diffstat (limited to 'buffer.c')
-rw-r--r--buffer.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/buffer.c b/buffer.c
index 235a59f..477a1c9 100644
--- a/buffer.c
+++ b/buffer.c
@@ -137,6 +137,15 @@ static inline Settings *buffer_settings(TextBuffer *buffer) {
return &buffer->ted->settings;
}
+// NOTE: this string will be invalidated when the line is edited!!!
+// only use it briefly!!
+static String32 buffer_get_line(TextBuffer *buffer, u32 line_number) {
+ Line *line = &buffer->lines[line_number];
+ return (String32) {
+ .str = line->str, .len = line->len
+ };
+}
+
// Returns a simple checksum of the buffer.
// This is only used for testing, and shouldn't be relied on.
static u64 buffer_checksum(TextBuffer *buffer) {