diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2024-01-22 13:40:19 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-22 13:40:19 +1100 |
commit | c2218133bc005fd714de5472d41fa638768e7a3a (patch) | |
tree | 8939ec45916f6412319ecb947314e6c0e6b91001 /pkg/gui/context/commit_files_context.go | |
parent | 221ebdc1fbfbaa02401d0218749430603038d801 (diff) | |
parent | 7c3d8921b737a77395851ccacb5cb1b2f659688a (diff) |
Show file names in default colour (#3081)
Fixes https://github.com/jesseduffield/lazygit/issues/3077
Show unstaged file names in default colour
Previously, we had the following rules:
* file names were in red when unstaged or partially staged
* directory names were in red if unstaged, yellow if partially staged,
and
green if fully staged
Red text on a black background can be hard to read, so instead I'm
changing it
so that unstaged files have their names in the default text colour.
I'm also making it so that partially staged files are in yellow, just
like how
partially staged directories are yellow (same deal with the commit files
view
when adding to a custom patch).
So the new rules are:
* unstaged files/directories use the default colour
* partially staged files/directories are in yellow
* fully staged files/directories are in green
I've also done a refactor on the code clean up some dead code from when
the file tree
outline was drawn with box characters, and I've made it so that the
indentation in
each line is handled inside the function that draws the line rather than
in the recursive
parent function. This makes it easier to experiment with things like
showing the file
status characters on the left edge of the view (admittedly after
experimenting with it,
I decided I didn't like it). Apologies for having a refactor and a
functional change
in the one commit but by the time I was done, I couldn't be bothered
going back and
retroactively splitting it into two halves.
Diffstat (limited to 'pkg/gui/context/commit_files_context.go')
-rw-r--r-- | pkg/gui/context/commit_files_context.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/gui/context/commit_files_context.go b/pkg/gui/context/commit_files_context.go index ad1ffa031..989ca9acb 100644 --- a/pkg/gui/context/commit_files_context.go +++ b/pkg/gui/context/commit_files_context.go @@ -33,7 +33,7 @@ func NewCommitFilesContext(c *ContextCommon) *CommitFilesContext { return [][]string{{style.FgRed.Sprint("(none)")}} } - lines := presentation.RenderCommitFileTree(viewModel, c.Modes().Diffing.Ref, c.Git().Patch.PatchBuilder) + lines := presentation.RenderCommitFileTree(viewModel, c.Git().Patch.PatchBuilder) return lo.Map(lines, func(line string, _ int) []string { return []string{line} }) |