summaryrefslogtreecommitdiff
path: root/buffer.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-01-30 13:21:53 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2021-01-30 13:21:53 -0500
commitb35a780479bbf5038a825d415f9ca49c92f6b425 (patch)
tree44e71007552714b03ae812e466495ec5c8a7e27b /buffer.c
parenta61d90c32d4d6448148894872ebd91eb8f10fc2e (diff)
ctrl+q to quit (with unsaved changes dialog)
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");