mirror of
https://github.com/taigrr/bubbletea.git
synced 2026-04-02 11:09:17 -07:00
Add border to split-editors example (#362)
* doc(textarea): add border to focused textarea in split-editors example * doc(textrea): tone down with border color in split-editors example Co-authored-by: Christian Rocha <christian@rocha.is>
This commit is contained in:
@@ -18,6 +18,8 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
cursorStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("212"))
|
||||||
|
|
||||||
cursorLineStyle = lipgloss.NewStyle().
|
cursorLineStyle = lipgloss.NewStyle().
|
||||||
Background(lipgloss.Color("57")).
|
Background(lipgloss.Color("57")).
|
||||||
Foreground(lipgloss.Color("230"))
|
Foreground(lipgloss.Color("230"))
|
||||||
@@ -27,6 +29,13 @@ var (
|
|||||||
|
|
||||||
focusedPlaceholderStyle = lipgloss.NewStyle().
|
focusedPlaceholderStyle = lipgloss.NewStyle().
|
||||||
Foreground(lipgloss.Color("99"))
|
Foreground(lipgloss.Color("99"))
|
||||||
|
|
||||||
|
focusedBorderStyle = lipgloss.NewStyle().
|
||||||
|
Border(lipgloss.RoundedBorder()).
|
||||||
|
BorderForeground(lipgloss.Color("238"))
|
||||||
|
|
||||||
|
blurredBorderStyle = lipgloss.NewStyle().
|
||||||
|
Border(lipgloss.HiddenBorder())
|
||||||
)
|
)
|
||||||
|
|
||||||
type keymap = struct {
|
type keymap = struct {
|
||||||
@@ -39,10 +48,12 @@ func newTextarea() textarea.Model {
|
|||||||
t.Prompt = ""
|
t.Prompt = ""
|
||||||
t.Placeholder = "Type something"
|
t.Placeholder = "Type something"
|
||||||
t.ShowLineNumbers = true
|
t.ShowLineNumbers = true
|
||||||
t.Cursor.Style = lipgloss.NewStyle().Foreground(lipgloss.Color("212"))
|
t.Cursor.Style = cursorStyle
|
||||||
t.FocusedStyle.Placeholder = focusedPlaceholderStyle
|
t.FocusedStyle.Placeholder = focusedPlaceholderStyle
|
||||||
t.BlurredStyle.Placeholder = placeholderStyle
|
t.BlurredStyle.Placeholder = placeholderStyle
|
||||||
t.FocusedStyle.CursorLine = cursorLineStyle
|
t.FocusedStyle.CursorLine = cursorLineStyle
|
||||||
|
t.FocusedStyle.Base = focusedBorderStyle
|
||||||
|
t.BlurredStyle.Base = blurredBorderStyle
|
||||||
t.KeyMap.DeleteWordBackward.SetEnabled(false)
|
t.KeyMap.DeleteWordBackward.SetEnabled(false)
|
||||||
t.KeyMap.LineNext = key.NewBinding(key.WithKeys("down"))
|
t.KeyMap.LineNext = key.NewBinding(key.WithKeys("down"))
|
||||||
t.KeyMap.LinePrevious = key.NewBinding(key.WithKeys("up"))
|
t.KeyMap.LinePrevious = key.NewBinding(key.WithKeys("up"))
|
||||||
|
|||||||
Reference in New Issue
Block a user