From 2a67fb2a5ea1238b3606b62a3de98fb80bf98547 Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Thu, 3 Apr 2008 17:02:15 +0200 Subject: [PATCH] Share the line number colors between blame view and others Renames the blame-lineno color to line-number. --- tig.c | 8 ++++---- tigrc.5.txt | 11 +++++------ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/tig.c b/tig.c index 551100f..a7499ea 100644 --- a/tig.c +++ b/tig.c @@ -586,6 +586,7 @@ LINE(DEFAULT, "", COLOR_DEFAULT, COLOR_DEFAULT, A_NORMAL), \ LINE(CURSOR, "", COLOR_WHITE, COLOR_GREEN, A_BOLD), \ LINE(STATUS, "", COLOR_GREEN, COLOR_DEFAULT, 0), \ LINE(DELIMITER, "", COLOR_MAGENTA, 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_DATE, "", COLOR_BLUE, COLOR_DEFAULT, 0), \ @@ -609,8 +610,7 @@ LINE(STAT_UNTRACKED,"", COLOR_MAGENTA, COLOR_DEFAULT, 0), \ LINE(BLAME_DATE, "", COLOR_BLUE, COLOR_DEFAULT, 0), \ LINE(BLAME_AUTHOR, "", COLOR_GREEN, COLOR_DEFAULT, 0), \ LINE(BLAME_COMMIT, "", COLOR_DEFAULT, COLOR_DEFAULT, 0), \ -LINE(BLAME_ID, "", COLOR_MAGENTA, COLOR_DEFAULT, 0), \ -LINE(BLAME_LINENO, "", COLOR_CYAN, COLOR_DEFAULT, 0) +LINE(BLAME_ID, "", COLOR_MAGENTA, COLOR_DEFAULT, 0) enum line_type { #define LINE(type, line, fg, bg, attr) \ @@ -1507,6 +1507,8 @@ draw_lineno(struct view *view, unsigned int lineno, int max, bool selected) if (max < max_number) max_number = max; + if (!selected) + wattrset(view->win, get_line_attr(LINE_LINE_NUMBER)); col = draw_text(view, number, max_number, showtrimmed, selected); if (col < max) { if (!selected) @@ -3635,8 +3637,6 @@ blame_draw(struct view *view, struct line *line, unsigned int lineno, bool selec } { - if (!selected) - wattrset(view->win, get_line_attr(LINE_BLAME_LINENO)); col += draw_lineno(view, lineno, view->width - col, selected); if (col >= view->width) return TRUE; diff --git a/tigrc.5.txt b/tigrc.5.txt index f226968..1325225 100644 --- a/tigrc.5.txt +++ b/tigrc.5.txt @@ -339,13 +339,12 @@ to any backgrounded windows and the current window. *title-blur*, *title-focus* -Cursor line colors:: +Misc colors:: -*cursor* +Colors for the cursor line, line numbers, and delimiter shown for truncated +lines. -Color of delimiter shown for truncated lines:: - -*delimiter* +*cursor*, *delimiter*, *line-number* Main view specific:: @@ -360,7 +359,7 @@ Blame view colors:: The colors used for the blame view are similar to those in the main view. The commit ID color can be colored using *blame-id*. -*blame-date*, *blame-author*, *blame-commit*, *blame-id*, *blame-lineno* +*blame-date*, *blame-author*, *blame-commit*, *blame-id* -- -- 2.30.2