summaryrefslogtreecommitdiff
path: root/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'buffer.c')
-rw-r--r--buffer.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/buffer.c b/buffer.c
index ec2b748..1402718 100644
--- a/buffer.c
+++ b/buffer.c
@@ -1788,9 +1788,10 @@ Status buffer_load_file(TextBuffer *buffer, char const *filename) {
void buffer_reload(TextBuffer *buffer) {
if (buffer->filename && !buffer_is_untitled(buffer)) {
BufferPos cursor_pos = buffer->cursor_pos;
- buffer_load_file(buffer, buffer->filename);
- buffer->cursor_pos = cursor_pos;
- buffer_validate_cursor(buffer);
+ if (buffer_load_file(buffer, buffer->filename)) {
+ buffer->cursor_pos = cursor_pos;
+ buffer_validate_cursor(buffer);
+ }
}
}