mirror of
https://github.com/chenasraf/watchr.git
synced 2026-05-17 17:28:06 +00:00
fix: esc button behavior
This commit is contained in:
1
Makefile
1
Makefile
@@ -48,7 +48,6 @@ precommit:
|
||||
echo "Running pre-commit checks..."; \
|
||||
echo "go fmt"; \
|
||||
go fmt ./...; \
|
||||
git add $$STAGED_FILES; \
|
||||
echo "go vet"; \
|
||||
go vet ./...; \
|
||||
echo "golangci-lint"; \
|
||||
|
||||
@@ -295,7 +295,16 @@ func (m *model) handleKeyPress(msg tea.KeyMsg) (tea.Model, tea.Cmd) {
|
||||
|
||||
// Normal mode keybindings
|
||||
switch msg.String() {
|
||||
case "q", "esc", "ctrl+c":
|
||||
case "q", "ctrl+c":
|
||||
m.cancel()
|
||||
return m, tea.Quit
|
||||
case "esc":
|
||||
// Clear filter if active, otherwise quit
|
||||
if m.filter != "" {
|
||||
m.filter = ""
|
||||
m.updateFiltered()
|
||||
return m, nil
|
||||
}
|
||||
m.cancel()
|
||||
return m, tea.Quit
|
||||
|
||||
|
||||
Reference in New Issue
Block a user