Code

Replace usage of the main-author color with the author color
authorJonas Fonseca <fonseca@diku.dk>
Wed, 4 Feb 2009 12:09:12 +0000 (13:09 +0100)
committerJonas Fonseca <fonseca@diku.dk>
Thu, 5 Feb 2009 08:30:56 +0000 (09:30 +0100)
It is used in draw_author() which is used by the main, blame and tree
views.

NEWS
tig.c
tigrc.5.txt

diff --git a/NEWS b/NEWS
index 733c98b811a2f836dea3d858dfeca4e0bb12574b..ceb0290c3434401c03aebd4ab5ce570a95f90bd6 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -11,6 +11,8 @@ Incompatibilities:
  - The "tree-parent" action was renamed to "parent". Warnings will be
    emitted for transition.
  - Remove parsing of deprecated option -S and subcommands log and diff.
+ - The "author" color replaces "main-author". Setting the latter will
+   now set the "author" color.
 
 Improvements:
 
diff --git a/tig.c b/tig.c
index df44fcf422cd6ad22b7b0d99aba63f789086ab8f..bd9a7a4bf0852cd23413adf32c5eb3282beaadde 100644 (file)
--- a/tig.c
+++ b/tig.c
@@ -918,7 +918,7 @@ LINE(PP_REFS,          "Refs: ",            COLOR_RED,      COLOR_DEFAULT,  0), \
 LINE(COMMIT,      "commit ",           COLOR_GREEN,    COLOR_DEFAULT,  0), \
 LINE(PARENT,      "parent ",           COLOR_BLUE,     COLOR_DEFAULT,  0), \
 LINE(TREE,        "tree ",             COLOR_BLUE,     COLOR_DEFAULT,  0), \
-LINE(AUTHOR,      "author ",           COLOR_CYAN,     COLOR_DEFAULT,  0), \
+LINE(AUTHOR,      "author ",           COLOR_GREEN,    COLOR_DEFAULT,  0), \
 LINE(COMMITTER,           "committer ",        COLOR_MAGENTA,  COLOR_DEFAULT,  0), \
 LINE(SIGNOFF,     "    Signed-off-by", COLOR_YELLOW,   COLOR_DEFAULT,  0), \
 LINE(ACKED,       "    Acked-by",      COLOR_YELLOW,   COLOR_DEFAULT,  0), \
@@ -930,7 +930,6 @@ LINE(DATE,         "",                      COLOR_BLUE,     COLOR_DEFAULT,  0), \
 LINE(LINE_NUMBER,  "",                 COLOR_CYAN,     COLOR_DEFAULT,  0), \
 LINE(TITLE_BLUR,   "",                 COLOR_WHITE,    COLOR_BLUE,     0), \
 LINE(TITLE_FOCUS,  "",                 COLOR_WHITE,    COLOR_BLUE,     A_BOLD), \
-LINE(MAIN_AUTHOR,  "",                 COLOR_GREEN,    COLOR_DEFAULT,  0), \
 LINE(MAIN_COMMIT,  "",                 COLOR_DEFAULT,  COLOR_DEFAULT,  0), \
 LINE(MAIN_TAG,     "",                 COLOR_MAGENTA,  COLOR_DEFAULT,  A_BOLD), \
 LINE(MAIN_LOCAL_TAG,"",                        COLOR_MAGENTA,  COLOR_DEFAULT,  0), \
@@ -1411,6 +1410,9 @@ option_color_command(int argc, const char *argv[])
                } else if (!string_enum_compare(argv[0], "main-date", strlen("main-date"))) {
                        info = get_line_info("date");
 
+               } else if (!string_enum_compare(argv[0], "main-author", strlen("main-author"))) {
+                       info = get_line_info("author");
+
                } else {
                        config_msg = "Unknown color name";
                        return ERR;
@@ -2030,7 +2032,7 @@ draw_author(struct view *view, const char *author)
                author = initials;
        }
 
-       return draw_field(view, LINE_MAIN_AUTHOR, author, opt_author_cols, trim);
+       return draw_field(view, LINE_AUTHOR, author, opt_author_cols, trim);
 }
 
 static bool
index bbca17d2d4bdfa618dc840cf3e2d70eea39aaf08..2beb269c11ab369e7402e784e1720478a2d84186 100644 (file)
@@ -370,6 +370,7 @@ title-blur          The title window of any backgrounded view.
 delimiter              Delimiter shown for truncated lines.
 line-number            Line numbers.
 date                   The commit date.
+author                 The commit author.
 ------------------------------------------------------------------------------
 
 ifdef::backend-xhtml11[]
@@ -378,7 +379,6 @@ ifdef::backend-xhtml11[]
 endif::backend-xhtml11[]
 Main view colors:
 ------------------------------------------------------------------------------
-main-author            The commit author.
 main-revgraph          The revision graph.
 main-commit            The commit comment.
 main-head              Label of the current branch.