summaryrefslogtreecommitdiff
path: root/buffer.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2023-08-13 22:19:21 -0300
committerpommicket <pommicket@gmail.com>2023-08-13 22:19:21 -0300
commit79af91046d6c9f8ddca52dee1cb72181168c0f73 (patch)
tree82b70ee555d20fc6036a7f97bf94f3853130d64a /buffer.c
parent74c32a957d8533f746c960e8f726670e3d6b1baf (diff)
fix ask-reload menu
Diffstat (limited to 'buffer.c')
-rw-r--r--buffer.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/buffer.c b/buffer.c
index cc9fd80..2743a05 100644
--- a/buffer.c
+++ b/buffer.c
@@ -206,6 +206,12 @@ double buffer_last_write_time(TextBuffer *buffer) {
return buffer->last_write_time;
}
+void buffer_ignore_changes_on_disk(TextBuffer *buffer) {
+ buffer->last_write_time = timespec_to_seconds(time_last_modified(buffer->path));
+ // no matter what, buffer_unsaved_changes should return true
+ buffer->undo_history_write_pos = U32_MAX;
+}
+
BufferPos buffer_cursor_pos(TextBuffer *buffer) {
return buffer->cursor_pos;
}