diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2021-01-18 20:54:07 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2021-01-18 20:54:07 -0500 |
commit | 8a4984e0e15fcfb0be6db242ab3f60325b80abd8 (patch) | |
tree | b71eb3ec8e715164a9347cb6ce7d6d83298309d0 /buffer.c | |
parent | 530001a433c847b40d109d08cd8ff0958efdca1c (diff) |
bug fixes, narrow file list based on search term
Diffstat (limited to 'buffer.c')
-rw-r--r-- | buffer.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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) { |