summaryrefslogtreecommitdiffstats
path: root/pkg/gui/context
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2023-10-18 21:57:30 +1100
committerJesse Duffield <jessedduffield@gmail.com>2024-01-22 13:31:05 +1100
commit7c3d8921b737a77395851ccacb5cb1b2f659688a (patch)
tree2467f36736efb23097fcfbcd6b7e464c84b9725a /pkg/gui/context
parent5c888a0b474ed2fc45c7640b4e73e2bf272f2d3c (diff)
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')
-rw-r--r--pkg/gui/context/commit_files_context.go2
-rw-r--r--pkg/gui/context/working_tree_context.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/pkg/gui/context/commit_files_context.go b/pkg/gui/context/commit_files_context.go
index 037554c91..674e5d7d6 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}
})
diff --git a/pkg/gui/context/working_tree_context.go b/pkg/gui/context/working_tree_context.go
index 0e0b8d72b..4be5f531f 100644
--- a/pkg/gui/context/working_tree_context.go
+++ b/pkg/gui/context/working_tree_context.go
@@ -24,7 +24,7 @@ func NewWorkingTreeContext(c *ContextCommon) *WorkingTreeContext {
)
getDisplayStrings := func(_ int, _ int) [][]string {
- lines := presentation.RenderFileTree(viewModel, c.Modes().Diffing.Ref, c.Model().Submodules)
+ lines := presentation.RenderFileTree(viewModel, c.Model().Submodules)
return lo.Map(lines, func(line string, _ int) []string {
return []string{line}
})