hachem.wtf
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md2
-rw-r--r--config.h5
-rw-r--r--todo.12
-rw-r--r--todo.c20
4 files changed, 22 insertions, 7 deletions
diff --git a/README.md b/README.md
index 3b11970..4763907 100644
--- a/README.md
+++ b/README.md
@@ -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
```
diff --git a/config.h b/config.h
index 9bad475..f036d6f 100644
--- a/config.h
+++ b/config.h
@@ -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", \
diff --git a/todo.1 b/todo.1
index fbe61e8..d54c641 100644
--- a/todo.1
+++ b/todo.1
@@ -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
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;
}