mirror of
https://github.com/charmbracelet/gum
synced 2024-06-03 06:12:19 +02:00
Compare commits
No commits in common. "38521ff8708cd2e3a3a83327105c131e7dbfc374" and "97feb1b4d031eb3f2ac5ccb20fa1bfd368db0655" have entirely different histories.
38521ff870
...
97feb1b4d0
|
@ -197,7 +197,7 @@ gum input --password > password.txt
|
||||||
|
|
||||||
Prompt for some multi-line text.
|
Prompt for some multi-line text.
|
||||||
|
|
||||||
Note: `CTRL+D` is used to complete text entry. `CTRL+C` and `esc` will cancel.
|
Note: `CTRL+D` and `esc` are used to complete text entry. `CTRL+C` will cancel.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
gum write > story.txt
|
gum write > story.txt
|
||||||
|
|
|
@ -9,7 +9,6 @@ import (
|
||||||
"github.com/alecthomas/kong"
|
"github.com/alecthomas/kong"
|
||||||
"github.com/charmbracelet/bubbles/filepicker"
|
"github.com/charmbracelet/bubbles/filepicker"
|
||||||
tea "github.com/charmbracelet/bubbletea"
|
tea "github.com/charmbracelet/bubbletea"
|
||||||
"github.com/charmbracelet/gum/internal/exit"
|
|
||||||
"github.com/charmbracelet/gum/style"
|
"github.com/charmbracelet/gum/style"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -54,9 +53,6 @@ func (o Options) Run() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
m = tm.(model)
|
m = tm.(model)
|
||||||
if m.aborted {
|
|
||||||
return exit.ErrAborted
|
|
||||||
}
|
|
||||||
|
|
||||||
if m.selectedPath == "" {
|
if m.selectedPath == "" {
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
|
|
|
@ -20,7 +20,6 @@ import (
|
||||||
type model struct {
|
type model struct {
|
||||||
filepicker filepicker.Model
|
filepicker filepicker.Model
|
||||||
selectedPath string
|
selectedPath string
|
||||||
aborted bool
|
|
||||||
quitting bool
|
quitting bool
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,9 +31,7 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||||
switch msg := msg.(type) {
|
switch msg := msg.(type) {
|
||||||
case tea.KeyMsg:
|
case tea.KeyMsg:
|
||||||
switch msg.String() {
|
switch msg.String() {
|
||||||
case "ctrl+c", "q", "esc":
|
case "ctrl+c", "q":
|
||||||
m.aborted = true
|
|
||||||
m.quitting = true
|
|
||||||
return m, tea.Quit
|
return m, tea.Quit
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue