Skip to content

Commit

Permalink
fix(write): max height, max chars (#753)
Browse files Browse the repository at this point in the history
  • Loading branch information
caarlos0 authored Dec 9, 2024
1 parent 2939e51 commit 01892a0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions write/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ func (o Options) Run() error {
a.Placeholder = o.Placeholder
a.ShowLineNumbers = o.ShowLineNumbers
a.CharLimit = o.CharLimit
a.MaxHeight = o.MaxLines

style := textarea.Style{
Base: o.BaseStyle.ToLipgloss(),
Expand Down
3 changes: 2 additions & 1 deletion write/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ type Options struct {
ShowCursorLine bool `help:"Show cursor line" default:"false" env:"GUM_WRITE_SHOW_CURSOR_LINE"`
ShowLineNumbers bool `help:"Show line numbers" default:"false" env:"GUM_WRITE_SHOW_LINE_NUMBERS"`
Value string `help:"Initial value (can be passed via stdin)" default:"" env:"GUM_WRITE_VALUE"`
CharLimit int `help:"Maximum value length (0 for no limit)" default:"400"`
CharLimit int `help:"Maximum value length (0 for no limit)" default:"0"`
MaxLines int `help:"Maximum number of lines (0 for no limit)" default:"0"`
ShowHelp bool `help:"Show help key binds" negatable:"" default:"true" env:"GUM_WRITE_SHOW_HELP"`
CursorMode string `prefix:"cursor." name:"mode" help:"Cursor mode" default:"blink" enum:"blink,hide,static" env:"GUM_WRITE_CURSOR_MODE"`
Timeout time.Duration `help:"Timeout until choose returns selected element" default:"0s" env:"GUM_WRITE_TIMEOUT"`
Expand Down

0 comments on commit 01892a0

Please sign in to comment.