Changed parse_config_file to loop over the file and parse every section in order so that the main section doesn't override urgency sections.
fix: sections above the main section get ignored #150
ldev105/fnott:fix_sec_above_main into master @ -963,2 +962,2 @@
char *_line = NULL;
size_t count = 0;
bool
parse_config_file_section(FILE *f, struct config *conf, const char *path, enum section section) {
I'd rather stay away from extensions, as far as possible; would you mind breaking this out to a non-nested function?
Fixed
@ -1062,0 +966,4 @@
char *_line = NULL;
size_t count = 0;
/* If the section is main we can parse as if we already encountered [main] */
bool found=section == SECTION_MAIN;
I think found is a rather bad name, given how it's used. Perhaps is_inside_active_section?
I changed it to inside_target_sec and the parameter to target_sec to match
cfb868fb72
b939f7b87e
Thanks!
Not sure if it was introduced by this PR, but some settings are flagged as invalid when used in sections other than main.
For example, setting anchor=top-right in [critical] or [low] results in invalid key: anchor.
Not all settings are valid for the urgency sections. Its not a bug
In that case, per-application settings support (as in mako) would be a useful addition. This could help with certain use cases, such as using fnott as an OSD. I'll open an issue for it.
No due date set.
No dependencies set.
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?