mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-13 11:21:13 +02: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
|
@ -1,6 +1,9 @@
|
||||||
2016-04-29 Peter Stephenson <p.stephenson@samsung.com>
|
2016-04-29 Peter Stephenson <p.stephenson@samsung.com>
|
||||||
|
|
||||||
* Sebastian: 39354: Src/Modules/curses.c: alter internal return
|
* Sebastian: 38356: Src/Modules/curses.c, Doc/Zsh/mod_curses.yo:
|
||||||
|
allow integers as colours in curses.
|
||||||
|
|
||||||
|
* Sebastian: 38354: Src/Modules/curses.c: alter internal return
|
||||||
code so as not to mask curses error code.
|
code so as not to mask curses error code.
|
||||||
|
|
||||||
2016-04-26 Barton E. Schaefer <schaefer@zsh.org>
|
2016-04-26 Barton E. Schaefer <schaefer@zsh.org>
|
||||||
|
|
|
@ -111,7 +111,11 @@ Each var(fg_col)tt(/)var(bg_col) attribute (to be read as
|
||||||
for character output. The color tt(default) is sometimes available
|
for character output. The color tt(default) is sometimes available
|
||||||
(in particular if the library is ncurses), specifying the foreground
|
(in particular if the library is ncurses), specifying the foreground
|
||||||
or background color with which the terminal started. The color pair
|
or background color with which the terminal started. The color pair
|
||||||
tt(default/default) is always available.
|
tt(default/default) is always available. To use more than the 8 named
|
||||||
|
colors (red, green, etc.) construct the var(fg_col)tt(/)var(bg_col)
|
||||||
|
pairs where var(fg_col) and var(bg_col) are decimal integers, e.g
|
||||||
|
tt(128/200). The maximum color value is 254 if the terminal supports
|
||||||
|
256 colors.
|
||||||
|
|
||||||
tt(bg) overrides the color and other attributes of all characters in the
|
tt(bg) overrides the color and other attributes of all characters in the
|
||||||
window. Its usual use is to set the background initially, but it will
|
window. Its usual use is to set the background initially, but it will
|
||||||
|
|
|
@ -350,8 +350,20 @@ zcurses_colorget(const char *nam, char *colorpair)
|
||||||
}
|
}
|
||||||
|
|
||||||
*bg = '\0';
|
*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 || b==-2) {
|
||||||
if (f == -2)
|
if (f == -2)
|
||||||
|
|
Loading…
Reference in a new issue