X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/tweak/blobdiff_plain/6e182d98f1e2191523a4a0b8532a73819d6dca8d..e09192eaab26168555edbc9bbc2ea994ba7c92db:/slang.c diff --git a/slang.c b/slang.c index 0dca727..172c5db 100644 --- a/slang.c +++ b/slang.c @@ -1,3 +1,5 @@ +#include "tweak.h" + #include #include #include @@ -11,8 +13,6 @@ #include -#include "tweak.h" - #if defined(unix) && !defined(GO32) static int sigwinch (int sigtype) { @@ -109,7 +109,7 @@ void display_write_chars(char *str, int len) SLsmg_write_nchars(str, len); } -void display_define_colour(int colour, int fg, int bg) +void display_define_colour(int colour, int fg, int bg, int reverse) { static char *colours[16] = { "black", "red", "green", "brown", @@ -119,6 +119,12 @@ void display_define_colour(int colour, int fg, int bg) }; char cname[40]; + if (fg < 0 && bg < 0) { + /* FIXME: not sure how to support terminal default fg+bg */ + fg = 7; + bg = 0; + } + sprintf(cname, "colour%d", colour); SLtt_set_color(colour, cname, colours[fg], colours[bg]);