mtm | Ncurses-based terminal multiplexer |
| download: https://git.y1.nz/archives/mtm.tar.gz | |
| Files | Log | Refs |
commit ee51f76c97334739d19a74dde5692ae28a497bb2 parent 5944ba164539de82edd11b4fd88b7f3e3fe441bb Author: Rob King <rob@frigidriver.com> Date: Wed, 17 Jun 2020 22:39:39 -0500 Properly handle init_pair. Diffstat:
| M | mtm.c | 1 | + |
| M | pair.c | 8 | ++++---- |
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/mtm.c b/mtm.c @@ -1152,6 +1152,7 @@ main(int argc, char **argv) intrflush(stdscr, FALSE); start_color(); use_default_colors(); + start_pairs(); root = newview(NULL, 0, 0, LINES, COLS); if (!root) diff --git a/pair.c b/pair.c @@ -4,7 +4,7 @@ #define COLOR_MAX 256 static short pairs[COLOR_MAX][COLOR_MAX]; -static short next = 0; +static short next = 1; void start_pairs(void) @@ -24,10 +24,10 @@ mtm_alloc_pair(int fg, int bg) return -1; if (fg >= COLOR_MAX || bg >= COLOR_MAX) return -1; - if (pairs[fg][bg] == -1) + if (pairs[fg][bg] == -1){ pairs[fg][bg] = next++; + init_pair(pairs[fg][bg], fg, bg); + } return pairs[fg][bg]; #endif } - -
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.