[hackers] [st-xresources][PATCH] fix: Fix the default `colorname[]` indexes for `background`, `foreground`, `cursorColor`

From: IT Department <info_AT_legalprimegsc.ru>
Date: Thu, 2 Apr 2020 23:52:33 +0300

The default indexes in the `resources[]` array seemed to be mixed, so that, this
produced an issue when the corresponding `.Xresources` values were
effecting wrong settings.
---
 config.def.h | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/config.def.h b/config.def.h
index 7f034ad..d0ed4d3 100644
--- a/config.def.h
+++ b/config.def.h
_AT_@ -110,9 +110,10 @@ static const char *colorname[] = {
 	[255] = 0,
 
 	/* more colors can be added after 255 to use with DefaultXX */
-	"#cccccc",
-	"#555555",
-	"black",
+	"#add8e6", /* 256 -> cursor */
+	"#555555", /* 257 -> rev cursor*/
+	"#282828", /* 258 -> bg */
+	"#ebdbb2", /* 259 -> fg */
 };
 
 
_AT_@ -120,7 +121,7 @@ static const char *colorname[] = {
  * Default colors (colorname index)
  * foreground, background, cursor, reverse cursor
  */
-unsigned int defaultfg = 7;
+unsigned int defaultfg = 259;
 unsigned int defaultbg = 258;
 static unsigned int defaultcs = 256;
 static unsigned int defaultrcs = 257;
_AT_@ -175,9 +176,9 @@ ResourcePref resources[] = {
 		{ "color13",      STRING,  &colorname[13] },
 		{ "color14",      STRING,  &colorname[14] },
 		{ "color15",      STRING,  &colorname[15] },
-		{ "background",   STRING,  &colorname[256] },
-		{ "foreground",   STRING,  &colorname[257] },
-		{ "cursorColor",  STRING,  &colorname[258] },
+		{ "background",   STRING,  &colorname[258] },
+		{ "foreground",   STRING,  &colorname[259] },
+		{ "cursorColor",  STRING,  &colorname[256] },
 		{ "termname",     STRING,  &termname },
 		{ "shell",        STRING,  &shell },
 		{ "xfps",         INTEGER, &xfps },
-- 
2.17.1
Received on Thu Apr 02 2020 - 22:52:33 CEST

This archive was generated by hypermail 2.3.0 : Thu Apr 02 2020 - 23:00:36 CEST