From 50d7be8d947b71e4dba181314fcf3392100d0080 Mon Sep 17 00:00:00 2001 From: ewy Date: Tue, 14 Apr 2026 19:23:00 +0200 Subject: cleanup --- menu/model.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'menu/model.go') diff --git a/menu/model.go b/menu/model.go index ceeb861..9d8fa82 100644 --- a/menu/model.go +++ b/menu/model.go @@ -11,6 +11,7 @@ type Model struct { Index int Indices map[int]model.HydratedTarget SourceIndices map[int]*model.HydratedSource + Quit bool } func (m *Model) Init() tea.Cmd { @@ -40,6 +41,7 @@ func (m *Model) HandleInput(msg tea.KeyMsg) (tea.Cmd, error) { case "down", "j": m.Index++ case "q", "esc": + m.Quit = true cmd = tea.Quit case "space", " ", "enter": cmd = tea.Quit @@ -59,6 +61,9 @@ func (m *Model) View() string { } func (m *Model) Result() (*model.HydratedSource, model.HydratedTarget) { + if m.Quit { + return nil, nil + } return m.SourceIndices[m.Index], m.Indices[m.Index] } -- cgit v1.3