4 "charm.land/lipgloss/v2"
5 "github.com/charmbracelet/x/exp/charmtone"
8// LineStyle defines the styles for a given line type in the diff view.
10 LineNumber lipgloss.Style
15// Style defines the overall style for the diff view, including styles for
16// different line types such as divider, missing, equal, insert, and delete
27// DefaultLightStyle provides a default light theme style for the diff view.
28func DefaultLightStyle() Style {
30 DividerLine: LineStyle{
31 LineNumber: lipgloss.NewStyle().
32 Foreground(charmtone.Iron).
33 Background(charmtone.Thunder),
34 Code: lipgloss.NewStyle().
35 Foreground(charmtone.Oyster).
36 Background(charmtone.Anchovy),
38 MissingLine: LineStyle{
39 LineNumber: lipgloss.NewStyle().
40 Background(charmtone.Ash),
41 Code: lipgloss.NewStyle().
42 Background(charmtone.Ash),
45 LineNumber: lipgloss.NewStyle().
46 Foreground(charmtone.Charcoal).
47 Background(charmtone.Ash),
48 Code: lipgloss.NewStyle().
49 Foreground(charmtone.Pepper).
50 Background(charmtone.Salt),
52 InsertLine: LineStyle{
53 LineNumber: lipgloss.NewStyle().
54 Foreground(charmtone.Turtle).
55 Background(lipgloss.Color("#c8e6c9")),
56 Symbol: lipgloss.NewStyle().
57 Foreground(charmtone.Turtle).
58 Background(lipgloss.Color("#e8f5e9")),
59 Code: lipgloss.NewStyle().
60 Foreground(charmtone.Pepper).
61 Background(lipgloss.Color("#e8f5e9")),
63 DeleteLine: LineStyle{
64 LineNumber: lipgloss.NewStyle().
65 Foreground(charmtone.Cherry).
66 Background(lipgloss.Color("#ffcdd2")),
67 Symbol: lipgloss.NewStyle().
68 Foreground(charmtone.Cherry).
69 Background(lipgloss.Color("#ffebee")),
70 Code: lipgloss.NewStyle().
71 Foreground(charmtone.Pepper).
72 Background(lipgloss.Color("#ffebee")),
75 LineNumber: lipgloss.NewStyle().
76 Foreground(charmtone.Iron).
77 Background(charmtone.Thunder),
78 Code: lipgloss.NewStyle().
79 Foreground(charmtone.Iron).
80 Background(charmtone.Thunder),
85// DefaultDarkStyle provides a default dark theme style for the diff view.
86func DefaultDarkStyle() Style {
88 DividerLine: LineStyle{
89 LineNumber: lipgloss.NewStyle().
90 Foreground(charmtone.Smoke).
91 Background(charmtone.Sapphire),
92 Code: lipgloss.NewStyle().
93 Foreground(charmtone.Smoke).
94 Background(charmtone.Ox),
96 MissingLine: LineStyle{
97 LineNumber: lipgloss.NewStyle().
98 Background(charmtone.Charcoal),
99 Code: lipgloss.NewStyle().
100 Background(charmtone.Charcoal),
102 EqualLine: LineStyle{
103 LineNumber: lipgloss.NewStyle().
104 Foreground(charmtone.Ash).
105 Background(charmtone.Charcoal),
106 Code: lipgloss.NewStyle().
107 Foreground(charmtone.Salt).
108 Background(charmtone.Pepper),
110 InsertLine: LineStyle{
111 LineNumber: lipgloss.NewStyle().
112 Foreground(charmtone.Turtle).
113 Background(lipgloss.Color("#293229")),
114 Symbol: lipgloss.NewStyle().
115 Foreground(charmtone.Turtle).
116 Background(lipgloss.Color("#303a30")),
117 Code: lipgloss.NewStyle().
118 Foreground(charmtone.Salt).
119 Background(lipgloss.Color("#303a30")),
121 DeleteLine: LineStyle{
122 LineNumber: lipgloss.NewStyle().
123 Foreground(charmtone.Cherry).
124 Background(lipgloss.Color("#332929")),
125 Symbol: lipgloss.NewStyle().
126 Foreground(charmtone.Cherry).
127 Background(lipgloss.Color("#3a3030")),
128 Code: lipgloss.NewStyle().
129 Foreground(charmtone.Salt).
130 Background(lipgloss.Color("#3a3030")),
133 LineNumber: lipgloss.NewStyle().
134 Foreground(charmtone.Smoke).
135 Background(charmtone.Sapphire),
136 Code: lipgloss.NewStyle().
137 Foreground(charmtone.Smoke).
138 Background(charmtone.Sapphire),
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list