vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
commit 1a16bf24bcad6e3eb48f95ab3efdbb012f876149 parent bdb7e082e351423686eb229f2f67009fd680a2ad Author: Marc André Tanner <mat@brain-dump.org> Date: Sun, 17 Jan 2016 13:59:54 +0100 ui: support color definitions in terms of the 256 color palette Diffstat:
| M | ui-curses.c | | | 3 | +++ |
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/ui-curses.c b/ui-curses.c @@ -450,6 +450,9 @@ static int color_fromstring(const char *s) if (n != 3) return -1; return color_find_rgb(r, g, b); + } else if ('0' <= *s && *s <= '9') { + int col = atoi(s); + return (col <= 0 || col > 255) ? -1 : col; } if (strcasecmp(s, "black") == 0)