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 /config.c | |
parent | 296b4eca9479bdd1302c4b2d910f3ddd8c955fb9 (diff) |
auto reload config
Diffstat (limited to 'config.c')
-rw-r--r-- | config.c | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -235,6 +235,7 @@ void config_read(Ted *ted, char const *filename, int pass) { {"auto-indent", &nullset->auto_indent, true}, {"auto-add-newline", &nullset->auto_add_newline, true}, {"auto-reload", &nullset->auto_reload, true}, + {"auto-reload-config", &nullset->auto_reload_config, false}, {"syntax-highlighting", &nullset->syntax_highlighting, true}, {"line-numbers", &nullset->line_numbers, true}, {"restore-session", &nullset->restore_session, false}, @@ -521,7 +522,7 @@ void config_read(Ted *ted, char const *filename, int pass) { boolean = false; } - // go through all options + // go through all options bool recognized = false; for (size_t i = 0; i < arr_count(all_options) && !recognized; ++i) { OptionAny const *any = &all_options[i]; @@ -574,6 +575,12 @@ void config_read(Ted *ted, char const *filename, int pass) { } } } + + // this is probably a bad idea: + //if (!recognized) + // config_err(cfg, "Unrecognized option: %s", key); + // because if we ever remove an option in the future + // everyone will get errors } break; } } @@ -594,7 +601,7 @@ void config_read(Ted *ted, char const *filename, int pass) { fclose(fp); } -static void config_free(Ted *ted) { +void config_free(Ted *ted) { for (u16 i = 0; i < LANG_COUNT; ++i) { free(ted->settings_by_language[0].language_extensions[i]); for (u16 l = 0; l < LANG_COUNT; ++l) { |