Skip to content

Commit

Permalink
Fix incorrect filename coloring in tig status
Browse files Browse the repository at this point in the history
Due to the way commit a37ce5c updated
src/draw.c:draw_filename() the whole line in `tig status` got colored
according to `stat-*` which are supposed to color only status markers.

This reverts part of that commit which was done for consistency with the
changes made to draw_filesize().
  • Loading branch information
xaizek committed Apr 7, 2024
1 parent d4a13ff commit aecf5e0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/draw.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,10 +276,11 @@ draw_id(struct view *view, struct view_column *column, const char *id)
}

static bool
draw_filename(struct view *view, struct view_column *column, enum line_type type, const char *filename)
draw_filename(struct view *view, struct view_column *column, const char *filename, mode_t mode)
{
size_t width = filename ? utf8_width(filename) : 0;
bool trim = width >= column->width;
enum line_type type = S_ISDIR(mode) ? LINE_DIRECTORY : LINE_FILE;
int column_width = column->width ? column->width : width;

if (column->opt.file_name.display == FILENAME_NO)
Expand Down Expand Up @@ -528,7 +529,7 @@ 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))
if (draw_filename(view, column, column_data.file_name, mode))
return true;
continue;

Expand Down

0 comments on commit aecf5e0

Please sign in to comment.