mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-27 04:40:59 +01:00
38356: allow integers as curses colours
This commit is contained in:
parent
7fc0c2d57d
commit
fea013b8e8
3 changed files with 23 additions and 4 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue