From 6e679bdf26fa4dae651aade985155bd424761a3a Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Wed, 5 Feb 2020 04:24:13 -0500 Subject: Modulo colors before comparing pairs Otherwise a new pair is allocated every time a high color is requested. --- ui.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui.c b/ui.c index 12205cc..894e04d 100644 --- a/ui.c +++ b/ui.c @@ -135,12 +135,14 @@ static attr_t colorAttr(short fg) { static short colorPair(short fg, short bg) { if (bg == -1) return 1 + fg; + fg %= COLORS; + bg %= COLORS; for (short pair = 17; pair < colorPairs; ++pair) { short f, b; pair_content(pair, &f, &b); if (f == fg && b == bg) return pair; } - init_pair(colorPairs, fg % COLORS, bg % COLORS); + init_pair(colorPairs, fg, bg); return colorPairs++; } -- cgit 1.4.0 ubmit' value='switch'/> dontfiles
summary refs log tree commit diff
path: root/home/.gnupg/gpg-agent.conf (unfollow)
Commit message (Expand)Author
2017-09-15Simplify zsh promptsJune McEnroe
2017-09-15Move typo words to separate fileJune McEnroe
2017-09-15Use 4-space indent everywhereJune McEnroe
2017-09-15Rename zsh scripts .zshJune McEnroe
2017-09-15Rename files directory etcJune McEnroe
2017-09-15Remove Code Tarmak 2 layoutJune McEnroe
2017-09-14Draw line in typoJune McEnroe
2017-09-14Count 5 letters as a wordJune McEnroe
2017-09-14Add .gitignore target to bins MakefileJune McEnroe
2017-09-14Add typing gameJune McEnroe
2017-09-13Include sys/types.h in wake.cJune McEnroe
2017-09-06Move C file description commentsJune McEnroe
2017-09-06Fix bin/Makefile FreeBSD compatibilityJune McEnroe
2017-09-06Remove C code from link scriptJune McEnroe
2017-09-06Move C code to bin, Makefile, AGPLJune McEnroe
2017-09-06Rename curtis -> homeJune McEnroe
2017-09-05Pass final NULL to execlpJune McEnroe
2017-09-05Add watch.cJune McEnroe
2017-09-02Remove Scala highlightingJune McEnroe
2017-08-31Fix Linux console Tarmak 3June McEnroe
2017-08-31Use Tarmak 3 on Linux consoleJune McEnroe
2017-08-25Install ddateJune McEnroe
2017-08-19Move nethack options to envJune McEnroe
2017-08-17Remove scala syntax fileJune McEnroe
2017-08-06Add wakeJune McEnroe
2017-08-04Use $() in install.shJune McEnroe
2017-08-02Create Code Tarmak 3 layoutJune McEnroe
2017-07-31Add tupJune McEnroe
2017-07-31Use designated initializer for hnel tableJune McEnroe
2017-07-30Add juneJune McEnroe
2017-07-30Play nethack as ValkyrieJune McEnroe
2017-07-28Add toggle to hnelJune McEnroe
2017-07-28Install slJune McEnroe
2017-07-25Add up, supJune McEnroe
2017-07-24Autopickup ringsJune McEnroe
2017-07-24Name dogJune McEnroe
2017-07-23Add nethackrcJune McEnroe
2017-07-23Remove useless setuid in briJune McEnroe
2017-07-23Clean up hnel a tiny bitJune McEnroe
2017-07-21Set window size in hnelJune McEnroe
2017-07-21Add hnelJune McEnroe
2017-07-19chmod 600 in dtchJune McEnroe