mirror of
https://github.com/charmbracelet/gum
synced 2026-03-14 13:45:45 +01:00
* Revert "feat: huh gum write (#525)" This reverts commit4d5d53169e. Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com> * Revert "Use Huh for Gum Confirm (#522)" This reverts commitf7572e387e. Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com> * revert: Use Huh for Gum Choose (#521) Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com> * revert: feat: huh for gum input (#524) * revert: feat: huh file picker (#523) * feat: remove huh * fix: timeouts * fix: lint issues * fix(choose): quit on ctrl+q ported over63a3e8c8ce* fix: ctrl+a to reverse selection Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com> * fix: better handle spin exit codes * fix(file): bind --[no-]permissions and --[no-]size * feat(confirm): show help * fix(confirm): fix help style * fix(file): help * fix(input): --no-show-help doesn't work * fix(input): help * fix(file): keymap improvement * fix(write): focus * feat(write): ctrl+e, keymaps, help * feat(choose): help * feat(filter): help * refactor: keymaps * fix(choose): only show 'toggle all' if there's no limit * fix(choose): don't show toggle if the choices are limited to 1 * fix(filter): match choose header color * fix(filter): add space above help * fix(filter): factor help into the height setting * chore(choose,filter): use verb for navigation label in help * fix(filter): hide toggle help if limit is 1 * fix(file): factor help into height setting (#746) * fix: lint issues * fix(file): handle ctrl+c * fix: remove full help * fix: lint --------- Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com> Co-authored-by: Christian Rocha <christian@rocha.is>
28 lines
2.3 KiB
Go
28 lines
2.3 KiB
Go
package write
|
|
|
|
import "github.com/charmbracelet/gum/style"
|
|
|
|
// Options are the customization options for the textarea.
|
|
type Options struct {
|
|
Width int `help:"Text area width (0 for terminal width)" default:"0" env:"GUM_WRITE_WIDTH"`
|
|
Height int `help:"Text area height" default:"5" env:"GUM_WRITE_HEIGHT"`
|
|
Header string `help:"Header value" default:"" env:"GUM_WRITE_HEADER"`
|
|
Placeholder string `help:"Placeholder value" default:"Write something..." env:"GUM_WRITE_PLACEHOLDER"`
|
|
Prompt string `help:"Prompt to display" default:"┃ " env:"GUM_WRITE_PROMPT"`
|
|
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"`
|
|
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"`
|
|
|
|
BaseStyle style.Styles `embed:"" prefix:"base." envprefix:"GUM_WRITE_BASE_"`
|
|
CursorLineNumberStyle style.Styles `embed:"" prefix:"cursor-line-number." set:"defaultForeground=7" envprefix:"GUM_WRITE_CURSOR_LINE_NUMBER_"`
|
|
CursorLineStyle style.Styles `embed:"" prefix:"cursor-line." envprefix:"GUM_WRITE_CURSOR_LINE_"`
|
|
CursorStyle style.Styles `embed:"" prefix:"cursor." set:"defaultForeground=212" envprefix:"GUM_WRITE_CURSOR_"`
|
|
EndOfBufferStyle style.Styles `embed:"" prefix:"end-of-buffer." set:"defaultForeground=0" envprefix:"GUM_WRITE_END_OF_BUFFER_"`
|
|
LineNumberStyle style.Styles `embed:"" prefix:"line-number." set:"defaultForeground=7" envprefix:"GUM_WRITE_LINE_NUMBER_"`
|
|
HeaderStyle style.Styles `embed:"" prefix:"header." set:"defaultForeground=240" envprefix:"GUM_WRITE_HEADER_"`
|
|
PlaceholderStyle style.Styles `embed:"" prefix:"placeholder." set:"defaultForeground=240" envprefix:"GUM_WRITE_PLACEHOLDER_"`
|
|
PromptStyle style.Styles `embed:"" prefix:"prompt." set:"defaultForeground=7" envprefix:"GUM_WRITE_PROMPT_"`
|
|
}
|