From 74f534feb1c2f80d6dca2ca7500383077fc0a453 Mon Sep 17 00:00:00 2001 From: xaizek Date: Sun, 7 Apr 2024 12:23:38 +0300 Subject: [PATCH] Fix incorrect filename coloring in `tig status` Due to the way commit a37ce5cfe1f256b81092dda365b1d66450e0929e updated src/draw.c:draw_filename() the whole line in `tig status` got colored according to `stat-*` which supposed to color only status markers. --- src/draw.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/draw.c b/src/draw.c index c2befa472..fadc37276 100644 --- a/src/draw.c +++ b/src/draw.c @@ -528,8 +528,13 @@ view_column_draw(struct view *view, struct line *line, unsigned int lineno) continue; case VIEW_COLUMN_FILE_NAME: - if (draw_filename(view, column, line->type, column_data.file_name)) + { + enum line_type type = line->type; + if (view->ops->flags & VIEW_STATUS_LIKE) + type = S_ISDIR(mode) ? LINE_DIRECTORY : LINE_FILE; + if (draw_filename(view, column, type, column_data.file_name)) return true; + } continue; case VIEW_COLUMN_SECTION: