summaryrefslogtreecommitdiff
path: root/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'buffer.c')
-rw-r--r--buffer.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/buffer.c b/buffer.c
index 11b1b6c..d7699db 100644
--- a/buffer.c
+++ b/buffer.c
@@ -640,6 +640,8 @@ void buffer_new_file(TextBuffer *buffer, char const *filename) {
buffer->nlines = 1;
}
+// Save the buffer to its current filename. This will rewrite the entire file, regardless of
+// whether there are any unsaved changes.
bool buffer_save(TextBuffer *buffer) {
if (!buffer->is_line_buffer && buffer->filename) {
FILE *out = fopen(buffer->filename, "wb");