diff options
Diffstat (limited to 'buffer.c')
-rw-r--r-- | buffer.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -94,6 +94,7 @@ void buffer_create(TextBuffer *buffer, Ted *ted) { buffer->ted = ted; } + void line_buffer_create(TextBuffer *buffer, Ted *ted) { buffer_create(buffer, ted); buffer->is_line_buffer = true; @@ -120,6 +121,11 @@ static bool buffer_pos_valid(TextBuffer *buffer, BufferPos p) { return p.line < buffer->nlines && p.index <= buffer->lines[p.line].len; } +// are there any unsaved changes? +bool buffer_unsaved_changes(TextBuffer *buffer) { + return buffer->modified; +} + // code point at position. // returns 0 if the position is invalid. note that it can also return 0 for a valid position, if there's a null character there char32_t buffer_char_at_pos(TextBuffer *buffer, BufferPos p) { |