1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
//! Nerd Font icon mapping for the leading column of tree rows.
//!
//! Design (important):
//! - Icons are **mostly monochrome = they inherit the terminal's default foreground**. No color is set here
//! (`ui/tree.rs` sets no Style = it automatically follows the user's theme color).
//! - In the future, color is applied semantically only to entries with a **git status (FR-7)**. No decorative per-extension colors.
//! - On terminals without a Nerd Font, `ui.icons = false` falls back to plain symbols
//! (branched on the caller side; if no icon is emitted, no tofu (□) appears either).
//!
//! Code points have been verified by rendering with the actual Symbols Nerd Font (standard devicons/seti positions).
use Path;
/// Icon for Markdown links (placed before the link label). Used only when `ui.icons=true`.
/// Icons for Markdown task-list checkboxes. Used only when `ui.icons=true`.
/// Unicode ☐/☑ (U+2610/U+2611) are East-Asian-Neutral = 1 cell to unicode-width, but CJK
/// fallback fonts draw them double-width, clipping the glyph and halving the focus highlight —
/// so like the tree icons we use Nerd Font glyphs (guaranteed 1 cell) instead.
/// Glyph for a repo's current branch (U+2387 ALTERNATIVE KEY SYMBOL, ⎇ — the conventional
/// git-branch icon). Used only when `ui.icons=true`; see `branch_marker`.
/// Glyph for the git graph's pinned base branch (U+2316 POSITION INDICATOR, ⌖). Used only when
/// `ui.icons=true`; see `base_marker`.
/// Display marker for a repo's current branch, placed directly before the branch name — the tree
/// root chip, the git changes/log titles, and the graph legend's HEAD entry. `icons=true` →
/// `branch_icon()` (⎇); `icons=false` → the ASCII label `"br:"`.
///
/// Neither Menlo/SF Mono/Monaco/Courier/Andale Mono/Courier New nor HackGen Console NF (measured
/// via a `fontTools` cmap dump) contain U+2387 — macOS always falls back to Apple Symbols, which
/// does, so the glyph never renders as tofu (□) there. But that fallback glyph's advance width
/// (~1.033em) is ~1.7x a Menlo cell's (~0.602em); if the terminal doesn't shrink it to fit the
/// cell, it can spill into the next cell — the same failure mode the ☐/☑ task icons had before
/// v0.6.0. Callers must put a space after the marker (never glue it directly to the next glyph)
/// so an oversized fallback glyph overflows into blank space instead of overlapping content.
/// Display marker for the git graph's pinned base branch, placed directly before the branch name
/// in the graph legend's base entry. `icons=true` → `base_icon()` (⌖); `icons=false` → the ASCII
/// label `"base:"`. Same overflow caveat as `branch_marker` — always follow with a space.
/// Icon for directories. Distinguished by open/closed state.
/// Icon for files. Resolved in order: special file name → extension → default (generic file).