feat: close input box when esc is pressed

This commit is contained in:
Himadri Bhattacharjee
2025-09-10 12:12:17 +05:30
parent 0da5267360
commit b05172a22e

View File

@@ -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
}
}