summaryrefslogtreecommitdiffstats
path: root/pkg/gui/presentation/icons/git_icons.go
diff options
context:
space:
mode:
authorJoel Baranick <joel.baranick@ensighten.com>2022-09-02 09:35:08 -0700
committerJesse Duffield <jessedduffield@gmail.com>2023-07-30 18:35:21 +1000
commitc679fd1924e9669a30d038fbdd164d948393c301 (patch)
treedac9a92eb38ee225d90c98446bf16067051e6c8b /pkg/gui/presentation/icons/git_icons.go
parent9a79154d05a81852a36ed336b6927ef60f835d6b (diff)
Style missing worktree as red and display better error when trying to switch to them
Use a broken link icon for missing worktrees
Diffstat (limited to 'pkg/gui/presentation/icons/git_icons.go')
-rw-r--r--pkg/gui/presentation/icons/git_icons.go24
1 files changed, 14 insertions, 10 deletions
diff --git a/pkg/gui/presentation/icons/git_icons.go b/pkg/gui/presentation/icons/git_icons.go
index 6b5689295..f6b56284e 100644
--- a/pkg/gui/presentation/icons/git_icons.go
+++ b/pkg/gui/presentation/icons/git_icons.go
@@ -7,14 +7,15 @@ import (
)
var (
- BRANCH_ICON = "\U000f062c" // 󰘬
- DETACHED_HEAD_ICON = "\ue729" // 
- TAG_ICON = "\uf02b" // 
- COMMIT_ICON = "\U000f0718" // 󰜘
- MERGE_COMMIT_ICON = "\U000f062d" // 󰘭
- DEFAULT_REMOTE_ICON = "\uf02a2" // 󰊢
- STASH_ICON = "\uf01c" // 
- LINKED_WORKTREE_ICON = "\uf838" // 
+ BRANCH_ICON = "\U000f062c" // 󰘬
+ DETACHED_HEAD_ICON = "\ue729" // 
+ TAG_ICON = "\uf02b" // 
+ COMMIT_ICON = "\U000f0718" // 󰜘
+ MERGE_COMMIT_ICON = "\U000f062d" // 󰘭
+ DEFAULT_REMOTE_ICON = "\uf02a2" // 󰊢
+ STASH_ICON = "\uf01c" // 
+ LINKED_WORKTREE_ICON = "\uf838" // 
+ MISSING_LINKED_WORKTREE_ICON = "\uf839" // 
)
var remoteIcons = map[string]string{
@@ -70,9 +71,12 @@ func IconForStash(stash *models.StashEntry) string {
return STASH_ICON
}
-func IconForWorktree(worktree *models.Worktree) string {
- if worktree.Main {
+func IconForWorktree(worktree *models.Worktree, missing bool) string {
+ if worktree.Main() {
return ""
}
+ if missing {
+ return MISSING_LINKED_WORKTREE_ICON
+ }
return LINKED_WORKTREE_ICON
}