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
26// DefaultLightStyle provides a default light theme style for the diff view.
27func DefaultLightStyle() Style {
29 DividerLine: LineStyle{
30 LineNumber: lipgloss.NewStyle().
31 Foreground(charmtone.Iron).
32 Background(charmtone.Thunder),
33 Code: lipgloss.NewStyle().
34 Foreground(charmtone.Oyster).
35 Background(charmtone.Anchovy),
37 MissingLine: LineStyle{
38 LineNumber: lipgloss.NewStyle().
39 Background(charmtone.Ash),
40 Code: lipgloss.NewStyle().
41 Background(charmtone.Ash),
44 LineNumber: lipgloss.NewStyle().
45 Foreground(charmtone.Charcoal).
46 Background(charmtone.Ash),
47 Code: lipgloss.NewStyle().
48 Foreground(charmtone.Pepper).
49 Background(charmtone.Salt),
51 InsertLine: LineStyle{
52 LineNumber: lipgloss.NewStyle().
53 Foreground(charmtone.Turtle).
54 Background(lipgloss.Color("#c8e6c9")),
55 Symbol: lipgloss.NewStyle().
56 Foreground(charmtone.Turtle).
57 Background(lipgloss.Color("#e8f5e9")),
58 Code: lipgloss.NewStyle().
59 Foreground(charmtone.Pepper).
60 Background(lipgloss.Color("#e8f5e9")),
62 DeleteLine: LineStyle{
63 LineNumber: lipgloss.NewStyle().
64 Foreground(charmtone.Cherry).
65 Background(lipgloss.Color("#ffcdd2")),
66 Symbol: lipgloss.NewStyle().
67 Foreground(charmtone.Cherry).
68 Background(lipgloss.Color("#ffebee")),
69 Code: lipgloss.NewStyle().
70 Foreground(charmtone.Pepper).
71 Background(lipgloss.Color("#ffebee")),
76// DefaultDarkStyle provides a default dark theme style for the diff view.
77func DefaultDarkStyle() Style {
79 DividerLine: LineStyle{
80 LineNumber: lipgloss.NewStyle().
81 Foreground(charmtone.Smoke).
82 Background(charmtone.Sapphire),
83 Code: lipgloss.NewStyle().
84 Foreground(charmtone.Smoke).
85 Background(charmtone.Ox),
87 MissingLine: LineStyle{
88 LineNumber: lipgloss.NewStyle().
89 Background(charmtone.Charcoal),
90 Code: lipgloss.NewStyle().
91 Background(charmtone.Charcoal),
94 LineNumber: lipgloss.NewStyle().
95 Foreground(charmtone.Ash).
96 Background(charmtone.Charcoal),
97 Code: lipgloss.NewStyle().
98 Foreground(charmtone.Salt).
99 Background(charmtone.Pepper),
101 InsertLine: LineStyle{
102 LineNumber: lipgloss.NewStyle().
103 Foreground(charmtone.Turtle).
104 Background(lipgloss.Color("#293229")),
105 Symbol: lipgloss.NewStyle().
106 Foreground(charmtone.Turtle).
107 Background(lipgloss.Color("#303a30")),
108 Code: lipgloss.NewStyle().
109 Foreground(charmtone.Salt).
110 Background(lipgloss.Color("#303a30")),
112 DeleteLine: LineStyle{
113 LineNumber: lipgloss.NewStyle().
114 Foreground(charmtone.Cherry).
115 Background(lipgloss.Color("#332929")),
116 Symbol: lipgloss.NewStyle().
117 Foreground(charmtone.Cherry).
118 Background(lipgloss.Color("#3a3030")),
119 Code: lipgloss.NewStyle().
120 Foreground(charmtone.Salt).
121 Background(lipgloss.Color("#3a3030")),
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