From 41005a0d4102843cefeed911a0fa8bd5774d998c Mon Sep 17 00:00:00 2001 From: hachem Date: Sat, 3 Oct 2026 17:27:07 +0200 Subject: fix: more refactoring holy hell --- config.h | 60 ++++++++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 48 insertions(+), 12 deletions(-) (limited to 'config.h') diff --git a/config.h b/config.h index 059d178..1b2d90c 100644 --- a/config.h +++ b/config.h @@ -1,12 +1,48 @@ -#define LEFT_MARGIN 2 -#define SECTION_INDENT 2 -#define SUBTASK_INDENT 4 -#define WRAP_COLUMN 80 - -#define MAX_ITEMS 4096 -#define MAX_TEXT 256 -#define MAX_COMMAND 64 -#define MAX_HISTORY 64 - -#define HIGHLIGHT "\x1b[48;5;235m" -#define HIGHLIGHT_RESET "\x1b[49m" +/* layout, in columns */ +#define LEFT_MARGIN 2 /* left padding for everything */ +#define SECTION_INDENT 2 /* extra indent per section depth */ +#define SUBTASK_INDENT 4 /* extra indent for subtasks */ +#define WRAP_COLUMN 80 /* wrap item text past this column */ + +/* colour theme (see todo.c for each): + * - THEME_DEFAULT + * - THEME_GRUVBOX + * - THEME_NORD + * - THEME_MONO + * - THEME_CUSTOM (the CUSTOM_THEME below) */ +#define THEME THEME_DEFAULT + +/* used when THEME is THEME_CUSTOM */ +#define CUSTOM_THEME { \ + .highlight = "\x1b[48;5;235m", .highlight_reset = "\x1b[49m", \ + .section = "\x1b[1m", .section_reset = "\x1b[22m", \ + .note = "\x1b[2;3m", .note_reset = "\x1b[22;23m", \ + .done = "\x1b[2m", .done_reset = "\x1b[22m", \ + .number = "\x1b[2m", .number_reset = "\x1b[22m", \ + .muted = "\x1b[2m", .muted_reset = "\x1b[0m", \ + .match = "\x1b[7m", .match_reset = "\x1b[27m", \ +} + +/* checkbox glyphs (display only; the file always stores [ ] [-] [x]). + * OPT_* are for optional (*) tasks; any width is fine. */ +#define MARK_TODO "[ ]" +#define MARK_DOING "[-]" +#define MARK_DONE "[x]" +#define MARK_OPT_TODO "( )" +#define MARK_OPT_DOING "(-)" +#define MARK_OPT_DONE "(x)" + +/* cursor shape per mode (DECSCUSR) */ +#define CURSOR_NORMAL "\x1b[2 q" /* block */ +#define CURSOR_INSERT "\x1b[6 q" /* bar */ +#define CURSOR_REPLACE "\x1b[4 q" /* underline */ + +/* header clock, strftime(3) formats */ +#define DATE_FORMAT "%a %d %b %Y" +#define TIME_FORMAT "%H:%M" + +/* limits (rarely need changing) */ +#define MAX_ITEMS 4096 /* most items in a list */ +#define MAX_TEXT 256 /* longest item text, in bytes */ +#define MAX_COMMAND 64 /* longest : command or / search */ +#define MAX_HISTORY 64 /* undo/redo depth */ -- cgit v1.3