diff options
| author | hachem <im@hachem.wtf> | 2026-10-10 23:34:47 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2026-10-10 23:34:47 +0200 |
| commit | ad9941c43fbd1cb9f54bd905ce730e5b9808ecdc (patch) | |
| tree | 3b3415140abd1ad1e0602714bdd2354e29792580 | |
| parent | bd54bc3e98d780ecf0a28f693aa803f2e46c728a (diff) | |
| -rw-r--r-- | README.md | 2 | ||||
| -rw-r--r-- | config.h | 5 | ||||
| -rw-r--r-- | todo.1 | 2 | ||||
| -rw-r--r-- | todo.c | 20 |
4 files changed, 22 insertions, 7 deletions
@@ -51,7 +51,7 @@ a little modal todo list that lives in my terminal. :clear remove every item :reorder re-sort / regroup the list :archive move done items out to the archive file (~/.todo.archive.txt) - :theme NAME switch theme (default, gruvbox, nord, mono, custom) + :theme NAME switch theme (default, gruvbox, nord, mono, light, custom) tab complete the command (or theme name) in the : line ``` @@ -10,9 +10,10 @@ * - THEME_GRUVBOX * - THEME_NORD * - THEME_MONO - * - THEME_CUSTOM (the CUSTOM_THEME below) + * - THEME_LIGHT + * - THEME_CUSTOM (the CUSTOM_THEME below) */ -#define THEME THEME_DEFAULT +#define THEME THEME_LIGHT #define CUSTOM_THEME { /* used when THEME is THEME_CUSTOM */ \ .highlight = "\x1b[48;5;235m", .highlight_reset = "\x1b[49m", \ .section = "\x1b[1m", .section_reset = "\x1b[22m", \ @@ -295,7 +295,7 @@ a valid list, so it can be opened with .BI :theme " name" Switch the colour theme to .I name -.RB ( default ", " gruvbox ", " nord ", " mono ", " custom ); +.RB ( default ", " gruvbox ", " nord ", " mono ", " light ", " custom ); with no name, cycle to the next. .SH OPTIONS .TP @@ -108,6 +108,7 @@ enum ThemeId THEME_GRUVBOX, THEME_NORD, THEME_MONO, + THEME_LIGHT, THEME_CUSTOM }; @@ -164,6 +165,16 @@ static const struct Theme themes[] = { .match = "\x1b[7m", .match_reset = "\x1b[27m", .important = "\x1b[1m", .important_reset = "\x1b[22m", }, + [THEME_LIGHT] = { + .highlight = "\x1b[48;5;252m", .highlight_reset = "\x1b[49m", + .section = "\x1b[1;38;5;25m", .section_reset = "\x1b[22;39m", + .note = "\x1b[3;38;5;66m", .note_reset = "\x1b[23;39m", + .done = "\x1b[38;5;245m", .done_reset = "\x1b[39m", + .number = "\x1b[38;5;246m", .number_reset = "\x1b[39m", + .muted = "\x1b[38;5;244m", .muted_reset = "\x1b[39m", + .match = "\x1b[30;48;5;222m", .match_reset = "\x1b[39;49m", + .important = "\x1b[1;38;5;124m", .important_reset = "\x1b[22;39m", + }, [THEME_CUSTOM] = CUSTOM_THEME, }; @@ -172,6 +183,7 @@ static const char* const theme_names[] = { [THEME_GRUVBOX] = "gruvbox", [THEME_NORD] = "nord", [THEME_MONO] = "mono", + [THEME_LIGHT] = "light", [THEME_CUSTOM] = "custom", }; @@ -731,12 +743,14 @@ static void apply_prose(struct List* list, int skip) for (int c = 0; c < len; c++) { - if (item->text[c] >= 'a' && item->text[c] <= 'z') + uint8_t ch = (uint8_t) item->text[c]; + + if (ch >= 'a' && ch <= 'z') { - item->text[c] = (char) (item->text[c] - 32); + item->text[c] = (char) (ch - 32); break; } - if (item->text[c] >= 'A' && item->text[c] <= 'Z') + if ((ch >= 'A' && ch <= 'Z') || ch >= 0x80) break; } |
