summaryrefslogtreecommitdiff
path: root/buffer.c
diff options
context:
space:
mode:
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) {