diff options
author | Sebastian Gniazdowski <sgniazdowski@gmail.com> | 2016-04-29 13:34:19 +0200 |
---|---|---|
committer | Peter Stephenson <pws@zsh.org> | 2016-04-29 14:01:06 +0100 |
commit | fea013b8e8cc3b2d8e7ca59c1f32b27cdf376155 (patch) | |
tree | 6c5c031a8652251a6fbbb321fc0cf7d38aec91ac /Src/Modules | |
parent | 7fc0c2d57db1c0ee71f66ff73ab5655294a245c0 (diff) | |
download | zsh-fea013b8e8cc3b2d8e7ca59c1f32b27cdf376155.tar.gz zsh-fea013b8e8cc3b2d8e7ca59c1f32b27cdf376155.tar.xz zsh-fea013b8e8cc3b2d8e7ca59c1f32b27cdf376155.zip |
38356: allow integers as curses colours
Diffstat (limited to 'Src/Modules')
-rw-r--r-- | Src/Modules/curses.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/Src/Modules/curses.c b/Src/Modules/curses.c index 7fff858f4..63c6748f5 100644 --- a/Src/Modules/curses.c +++ b/Src/Modules/curses.c @@ -350,8 +350,20 @@ zcurses_colorget(const char *nam, char *colorpair) } *bg = '\0'; - f = zcurses_color(cp); - b = zcurses_color(bg+1); + + // cp/bg can be {number}/{number} or {name}/{name} + + if( cp[0] >= '0' && cp[0] <= '9' ) { + f = atoi(cp); + } else { + f = zcurses_color(cp); + } + + if( (bg+1)[0] >= '0' && (bg+1)[0] <= '9' ) { + b = atoi(bg+1); + } else { + b = zcurses_color(bg+1); + } if (f==-2 || b==-2) { if (f == -2) |