diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2021-02-01 12:45:37 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2021-02-01 12:45:37 -0500 |
commit | e53329668e403a6b73bc8c9b56ad6b55eecba4e9 (patch) | |
tree | ca87e777053112f5de53155374f2272d6aad0ca1 /buffer.c | |
parent | 11b50663dc489b7ec8cb1c8774d9bda2c7acac3b (diff) |
fix C hex literal highlighting
also open to untitled empty buffer
Diffstat (limited to 'buffer.c')
-rw-r--r-- | buffer.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -52,6 +52,10 @@ char const *buffer_get_filename(TextBuffer *buffer) { return buffer->filename; } +bool buffer_is_untitled(TextBuffer *buffer) { + return streq(buffer->filename, TED_UNTITLED); +} + // clear all undo and redo events void buffer_clear_undo_redo(TextBuffer *buffer) { buffer_clear_undo_history(buffer); @@ -132,7 +136,7 @@ static bool buffer_pos_valid(TextBuffer *buffer, BufferPos p) { // are there any unsaved changes? bool buffer_unsaved_changes(TextBuffer *buffer) { - if (streq(buffer->filename, TED_UNTITLED) && buffer_empty(buffer)) + if (buffer_is_untitled(buffer) && buffer_empty(buffer)) return false; // don't worry about empty untitled buffers return buffer->modified; } |