diff options
author | pommicket <pommicket@gmail.com> | 2022-07-29 15:46:13 -0400 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2022-07-29 15:46:13 -0400 |
commit | efce2c731927adc4aaf26d6cc6c165bbced39eb5 (patch) | |
tree | 39c4eca8347f132c413a7405c2c3ae35d0fb0903 /buffer.c | |
parent | 296b4eca9479bdd1302c4b2d910f3ddd8c955fb9 (diff) |
auto reload config
Diffstat (limited to 'buffer.c')
-rw-r--r-- | buffer.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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)); |