22package bubblehelp
33
44import (
5- "github.com/charmbracelet/bubbles/key"
6- "github.com/charmbracelet/lipgloss"
75 "log"
86 "math"
97 "strings"
8+
9+ "github.com/charmbracelet/bubbles/key"
10+ "github.com/charmbracelet/lipgloss"
1011)
1112
1213var (
@@ -21,11 +22,36 @@ var (
2122
2223 // previousContext allows to reset the previous context.
2324 previousContext KeymapContext
25+
26+ // defaultStyle is used by defautl by all keymaps.
27+ defaultStyle Style
2428)
2529
2630// Init is the first function that needs to be called in the start of the app.
2731func Init () {
2832 Contexts = make (map [KeymapContext ]* Keymap )
33+ defaultStyle = Style {
34+ EssentialKey : lipgloss .NewStyle ().
35+ Bold (true ),
36+ EssentialKeyDescription : lipgloss .NewStyle ().
37+ Italic (true ),
38+ EssentialKeySeparator : lipgloss .NewStyle ().
39+ Italic (true ),
40+ EssentialKeySeparatorValue : " - " ,
41+ EssentialColSeparator : lipgloss .NewStyle ().
42+ Bold (true ),
43+ EssentialColSeparatorValue : " • " ,
44+ FullKey : lipgloss .NewStyle ().
45+ Bold (true ),
46+ FullKeyDescription : lipgloss .NewStyle ().
47+ Italic (true ),
48+ FullKeySeparator : lipgloss .NewStyle ().
49+ Italic (true ),
50+ FullKeySeparatorValue : " - " ,
51+ FullColSeparator : lipgloss .NewStyle ().
52+ Italic (true ),
53+ FullColSeparatorValue : " " ,
54+ }
2955}
3056
3157// RegisterContext allows to register a new Keymap context and link it with the given identifier.
@@ -195,3 +221,7 @@ func ViewEssential(keymap *Keymap, width int) string {
195221 AlignHorizontal (lipgloss .Center ).
196222 Width (width ).Render (b .String ())
197223}
224+
225+ func SetDefaultStyle (style Style ) {
226+ defaultStyle = style
227+ }
0 commit comments