6 "github.com/charmbracelet/crush/internal/app"
7 "github.com/charmbracelet/crush/internal/config"
8 "github.com/charmbracelet/crush/internal/ui/styles"
9 uv "github.com/charmbracelet/ultraviolet"
12// Common defines common UI options and configurations.
18// Config returns the configuration associated with this [Common] instance.
19func (c *Common) Config() *config.Config {
23// DefaultCommon returns the default common UI configurations.
24func DefaultCommon(app *app.App) *Common {
25 s := styles.DefaultStyles()
32// CenterRect returns a new [Rectangle] centered within the given area with the
33// specified width and height.
34func CenterRect(area uv.Rectangle, width, height int) uv.Rectangle {
35 centerX := area.Min.X + area.Dx()/2
36 centerY := area.Min.Y + area.Dy()/2
37 minX := centerX - width/2
38 minY := centerY - height/2
41 return image.Rect(minX, minY, maxX, maxY)
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