Skip to content

Commit

Permalink
fix: chat example
Browse files Browse the repository at this point in the history
  • Loading branch information
maaslalani committed Jun 28, 2022
1 parent 20c0e5a commit 8692d20
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
13 changes: 11 additions & 2 deletions examples/chat/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,26 @@ func initialModel() model {
ta := textarea.New()
ta.Placeholder = "Send a message..."
ta.Focus()

ta.Prompt = "┃ "
ta.CharLimit = 280
ta.Width = 30
ta.Height = 3

ta.SetWidth(30)
ta.SetHeight(3)

// Remove cursor line styling
ta.FocusedStyle.CursorLine = lipgloss.NewStyle()

ta.ShowLineNumbers = false

vp := viewport.New(30, 10)
vp.SetContent(`Welcome to the Bubbles multi-line text input!
Try typing any message and pressing ENTER.
If you write a long message, it will automatically wrap :D
`)

ta.KeyMap.InsertNewline.SetEnabled(false)

return model{
textarea: ta,
messages: []string{},
Expand Down
6 changes: 3 additions & 3 deletions examples/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ module examples
go 1.13

require (
github.com/charmbracelet/bubbles v0.11.1-0.20220622203329-a207867ff1b6
github.com/charmbracelet/bubbletea v0.21.1-0.20220615005246-f4b89fd7dd10
github.com/charmbracelet/bubbles v0.12.0
github.com/charmbracelet/bubbletea v0.22.0
github.com/charmbracelet/glamour v0.5.0
github.com/charmbracelet/lipgloss v0.5.1-0.20220615005615-2e17a8a06096
github.com/charmbracelet/lipgloss v0.5.0
github.com/fogleman/ease v0.0.0-20170301025033-8da417bf1776
github.com/lucasb-eyer/go-colorful v1.2.0
github.com/mattn/go-isatty v0.0.14
Expand Down
2 changes: 2 additions & 0 deletions examples/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ github.com/charmbracelet/harmonica v0.2.0 h1:8NxJWRWg/bzKqqEaaeFNipOu77YR5t8aSwG
github.com/charmbracelet/harmonica v0.2.0/go.mod h1:KSri/1RMQOZLbw7AHqgcBycp8pgJnQMYYT8QZRqZ1Ao=
github.com/charmbracelet/lipgloss v0.5.0 h1:lulQHuVeodSgDez+3rGiuxlPVXSnhth442DATR2/8t8=
github.com/charmbracelet/lipgloss v0.5.0/go.mod h1:EZLha/HbzEt7cYqdFPovlqy5FZPj0xFhg5SaqxScmgs=
github.com/charmbracelet/lipgloss v0.5.1-0.20220407020210-a86f21a0ae43 h1:xO5Bh21Ii+0p3EYp1GdFEF/Iax7VhBgMbBVCOFBZ2/Q=
github.com/charmbracelet/lipgloss v0.5.1-0.20220407020210-a86f21a0ae43/go.mod h1:EZLha/HbzEt7cYqdFPovlqy5FZPj0xFhg5SaqxScmgs=
github.com/charmbracelet/lipgloss v0.5.1-0.20220615005615-2e17a8a06096 h1:ai19sA3Zyg3DARevWCbdLOWt+MfWiE3e8voBqzFOgP8=
github.com/charmbracelet/lipgloss v0.5.1-0.20220615005615-2e17a8a06096/go.mod h1:D7uPgcyfB9T1Ug2mfJOnES17o47nz5oqIzSSVrpcviU=
github.com/containerd/console v1.0.3 h1:lIr7SlA5PxZyMV30bDW0MGbiOPXwc63yRuCP0ARubLw=
Expand Down

0 comments on commit 8692d20

Please sign in to comment.