summaryrefslogtreecommitdiff
path: root/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'buffer.c')
-rw-r--r--buffer.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/buffer.c b/buffer.c
index d73e68c..65a90ab 100644
--- a/buffer.c
+++ b/buffer.c
@@ -2178,8 +2178,13 @@ bool buffer_save(TextBuffer *buffer) {
}
buffer->last_write_time = time_last_modified(buffer->filename);
bool success = !buffer_haserr(buffer);
- if (success)
+ if (success) {
buffer->undo_history_write_pos = arr_len(buffer->undo_history);
+ char const *name = buffer->filename ? path_filename(buffer->filename) : TED_UNTITLED;
+ if (streq(name, "ted.cfg") && buffer_settings(buffer)->auto_reload_config) {
+ ted_load_configs(buffer->ted);
+ }
+ }
return success;
} else {
buffer_seterr(buffer, "Couldn't open file %s for writing: %s.", buffer->filename, strerror(errno));