commit a6e0326291eee1e1f8ee723ac1e8467ed0561e86
parent 1da4ff928a44f590e2c72cda1dcb4b097845cbc3
Author: René Wagner <rwagner@rw-net.de>
Date: Wed, 6 Jan 2021 20:50:43 +0100
different colors for local and remote gemini links
Diffstat:
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/README.md b/README.md
@@ -25,7 +25,8 @@ The actual colors used depend on your terminal palette:
- heading 1: light red
- heading 2: light yellow
- heading 3: light green
-- gemini link: light cyan
+- gemini link on same capsule: light cyan
+- gemini link to another capsule: dark cyan
- non-gemini link: light magenta
- quote: light gray
diff --git a/src/cgmnlm.c b/src/cgmnlm.c
@@ -24,7 +24,8 @@
#define ANSI_COLOR_YELLOW "\x1b[93m"
#define ANSI_COLOR_BLUE "\x1b[94m"
#define ANSI_COLOR_MAGENTA "\x1b[95m"
-#define ANSI_COLOR_CYAN "\x1b[96m"
+#define ANSI_COLOR_CYAN "\x1b[36m"
+#define ANSI_COLOR_LCYAN "\x1b[96m"
#define ANSI_COLOR_GRAY "\x1b[37m"
#define ANSI_COLOR_RESET "\x1b[0m"
@@ -815,7 +816,7 @@ repeat:
break;
case GEMINI_LINK:
if (text == NULL) {
- col += fprintf(out, "%2d) %s", nlinks++, (!strncmp("gemini://", tok.link.url, 9) || strstr(tok.link.url, "://") == NULL) ? ANSI_COLOR_CYAN : ANSI_COLOR_MAGENTA);
+ col += fprintf(out, "%2d) %s", nlinks++, (!strncmp("gemini://", tok.link.url, 9)) ? ANSI_COLOR_CYAN : ((strstr(tok.link.url, "://") == NULL) ? ANSI_COLOR_LCYAN : ANSI_COLOR_MAGENTA));
text = trim_ws(tok.link.text ? tok.link.text : tok.link.url);
*next = calloc(1, sizeof(struct link));
(*next)->url = strdup(trim_ws(tok.link.url));