summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d06137e)
raw | patch | inline | side by side (parent: d06137e)
author | Witold Filipczyk <witekfl@poczta.onet.pl> | |
Sat, 7 Feb 2009 00:16:35 +0000 (01:16 +0100) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Sat, 7 Feb 2009 00:30:24 +0000 (01:30 +0100) |
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
NEWS | patch | blob | history | |
tig.c | patch | blob | history | |
tigrc.5.txt | patch | blob | history |
index 25be94703fddff26a687b72396e0dc5e51231369..39ad78423a13427452a9545b9c2145b2e46804b5 100644 (file)
--- a/NEWS
+++ b/NEWS
- Status view: improve "on branch" information inspired by the prompt
code in git's bash completion script.
+ - Colors for 256-capable terminals can be specified as colorN.
tig-0.14
--------
index e25ba686ea8b26ebc8f21b2e95cdfa2bc44c97ad..79afdb1a11f8ab83dba1b7129c21b102fb42533a 100644 (file)
--- a/tig.c
+++ b/tig.c
ATTR_MAP(UNDERLINE),
};
-#define set_color(color, name) map_enum(color, color_map, name)
#define set_attribute(attr, name) map_enum(attr, attr_map, name)
+static int
+parse_int(int *opt, const char *arg, int min, int max)
+{
+ int value = atoi(arg);
+
+ if (min <= value && value <= max)
+ *opt = value;
+ return OK;
+}
+
+static bool
+set_color(int *color, const char *name)
+{
+ if (map_enum(color, color_map, name))
+ return TRUE;
+ if (!prefixcmp(name, "color"))
+ return parse_int(color, name + 5, 0, 255) == OK;
+ return FALSE;
+}
+
static int config_lineno;
static bool config_errors;
static const char *config_msg;
return OK;
}
-static int
-parse_int(int *opt, const char *arg, int min, int max)
-{
- int value = atoi(arg);
-
- if (min <= value && value <= max)
- *opt = value;
- return OK;
-}
-
static int
parse_string(char *opt, const char *arg, size_t optsize)
{
diff --git a/tigrc.5.txt b/tigrc.5.txt
index 6f11102a1f9384852f05636a02eaf78ff2951029..d37b8b8e3922acae0b60fa60ba1a03d209cc8dd7 100644 (file)
--- a/tigrc.5.txt
+++ b/tigrc.5.txt
Valid colors include: *white*, *black*, *green*, *magenta*, *blue*,
*cyan*, *yellow*, *red*, *default*. Use *default* to refer to the
- default terminal colors. This is recommended for background colors
- if you are using a terminal with a transparent background.
+ default terminal colors. This is recommended for background colors if
+ you are using a terminal with a transparent background.
++
+Colors can also be specified using the keywords color0, color1, ..., colorN-1
+(N being the number of colors supported by your terminal). This is useful when
+you remap the colors for your display or want to enable colors supported by
+256-color terminals.
Attribute names::