diff options
author | pommicket <pommicket@gmail.com> | 2022-11-03 20:57:40 -0400 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2022-11-03 20:59:34 -0400 |
commit | 45a9d9bec845bc62fa24e8390bb55a33ea45f198 (patch) | |
tree | b2f84a9ffca697b4e608309f8109c7e35e9f561e | |
parent | e84f168f69f9f3d8dc13465adb5628b5b2fa78d3 (diff) |
[1.3] some SettingsContext comments, updated version history
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | config.c | 1 | ||||
-rw-r--r-- | ted.h | 16 |
3 files changed, 18 insertions, 0 deletions
@@ -164,6 +164,7 @@ Then, open windows\_installer\\ted\\ted.sln, and build. <tr><td>1.2</td> <td>Bug fixes, per-language settings</td> <td>2022 Jul 29</td></tr> <tr><td>1.2r1</td> <td>Mouse X1/X2 bug fix, support for X1/X2 commands.</td> <td>2022 Aug 19</td></tr> <tr><td>1.2r2</td> <td>Shift+PgUp/PgDown, many rust-related fixes.</td> <td>2022 Sep 30</td></tr> +<tr><td>1.3</td> <td>Custom background shader, some bugfixes.</td> <td>2022 Nov 3</td></tr> </table> ## License @@ -27,6 +27,7 @@ static void context_copy(SettingsContext *dest, const SettingsContext *src) { dest->path = str_dup(src->path); } +/* does being in the context of `parent` imply you are in the context of `child`? */ static bool context_is_parent(const SettingsContext *parent, const SettingsContext *child) { if (child->language == 0 && parent->language != 0) return false; @@ -138,6 +138,8 @@ typedef struct KeyAction { i64 argument; } KeyAction; +// a SettingsContext is a context where a specific set of settings are applied. +// this corresponds to [PATH//LANGUAGE.(section)] in config files typedef struct { Language language; // these settings apply to this language. char *path; // these settings apply to all paths which start with this string, or all paths if path=NULL @@ -470,6 +472,20 @@ void ted_switch_to_buffer(Ted *ted, TextBuffer *buffer); Settings *ted_active_settings(Ted *ted); void ted_load_configs(Ted *ted, bool reloading); static TextBuffer *find_search_buffer(Ted *ted); +// first, we read all config files, then we parse them. +// this is because we want less specific settings (e.g. settings applied +// to all languages instead of one particular language) to be applied first, +// then more specific settings are based off of those. +// EXAMPLE: +// ---config file 1--- +// [Javascript.core] +// syntax-highlighting = off +// (inherits tab-width = 4) +// [CSS.core] +// tab-width = 2 (overrides tab-width = 4) +// ---config file 2--- +// [core] +// tab-width = 4 void config_read(Ted *ted, ConfigPart **parts, const char *filename); void config_parse(Ted *ted, ConfigPart **parts); void config_free(Ted *ted); |