From 4dd9b8a6340bb7d4d4d77599a42ee09e17c9bb92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20B=C3=BCtow?= <1224732+snonux@users.noreply.github.com> Date: Fri, 20 Jun 2025 09:51:52 +0300 Subject: Add external editor support --- internal/task/task.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'internal/task') diff --git a/internal/task/task.go b/internal/task/task.go index f7a3f73..12671a9 100644 --- a/internal/task/task.go +++ b/internal/task/task.go @@ -142,6 +142,15 @@ func Denotate(id int, annoID int) error { } // Edit opens the task in an editor for manual modification. +// EditCmd returns an exec.Cmd that edits the task with the given id. +// The caller is responsible for running the command, typically via +// tea.ExecProcess so that the terminal state is properly managed. +func EditCmd(id int) *exec.Cmd { + return exec.Command("task", strconv.Itoa(id), "edit") +} + +// Edit opens the task in an editor for manual modification. +// This is a convenience wrapper around EditCmd. func Edit(id int) error { - return run(strconv.Itoa(id), "edit") + return EditCmd(id).Run() } -- cgit v1.2.3