From ad9941c43fbd1cb9f54bd905ce730e5b9808ecdc Mon Sep 17 00:00:00 2001 From: hachem Date: Sat, 10 Oct 2026 23:34:47 +0200 Subject: fix: capital é and light theme MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- todo.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'todo.c') diff --git a/todo.c b/todo.c index ae53e86..1f933f2 100644 --- a/todo.c +++ b/todo.c @@ -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; } -- cgit v1.3