feat: close input box when esc is pressed
This commit is contained in:
7
main.go
7
main.go
@@ -8,20 +8,15 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
// "io"
|
||||
"log"
|
||||
"os"
|
||||
|
||||
// "os/exec"
|
||||
// "strings"
|
||||
|
||||
"github.com/charmbracelet/bubbles/list"
|
||||
"github.com/charmbracelet/bubbles/textinput"
|
||||
tea "github.com/charmbracelet/bubbletea"
|
||||
"github.com/charmbracelet/lipgloss"
|
||||
"github.com/go-git/go-git/v6"
|
||||
"github.com/go-git/go-git/v6/plumbing/object"
|
||||
// "golang.org/x/term"
|
||||
)
|
||||
|
||||
var docStyle = lipgloss.NewStyle().Margin(1, 2)
|
||||
@@ -73,6 +68,8 @@ func (m Model) TextUpdate(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||
m.ChangeDate()
|
||||
m.FetchGitLog()
|
||||
m.chosen = nil
|
||||
case tea.KeyEsc:
|
||||
m.chosen = nil
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user