summaryrefslogtreecommitdiff
path: root/internal/client/tui/compose.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2024-08-03 14:11:18 +0300
committerPaul Buetow <paul@buetow.org>2024-08-03 14:11:18 +0300
commit911bac5345502d099e93aa72a79b91e9ba14f01f (patch)
tree0edf4a7de7cb9d6901c690342447d7483646bd4a /internal/client/tui/compose.go
parent5664c4ad14fca54a42356541847e6ae3f9613a87 (diff)
adding Cmd to all functions returning a tea.Cmd
Diffstat (limited to 'internal/client/tui/compose.go')
-rw-r--r--internal/client/tui/compose.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/client/tui/compose.go b/internal/client/tui/compose.go
index c2d5c16..61883f8 100644
--- a/internal/client/tui/compose.go
+++ b/internal/client/tui/compose.go
@@ -20,19 +20,19 @@ const (
submitAfterCompose
)
-func composeAction(ctx context.Context, conf config.ClientConfig, postAction composePostAction) tea.Cmd {
+func composeActionCmd(ctx context.Context, conf config.ClientConfig, postAction composePostAction) tea.Cmd {
err := ensureDirectoryExists(conf.DataDir)
composeFile := fmt.Sprintf("%s/%s", conf.DataDir, conf.ComposeFile)
log.Println("Composing", composeFile)
- return openEditor(conf.Editor, composeFile, func() error {
+ return openEditorCmd(conf.Editor, composeFile, func() error {
if err != nil {
return err
}
switch postAction {
case submitAfterCompose:
- return submitEntryNoCmd(ctx, conf, composeFile)
+ return submitEntry(ctx, conf, composeFile)
case queueAfterCompose:
timestamp := time.Now().Format("20060102-150405")
queuedFile := fmt.Sprintf("%s/queued-%s.txt", conf.DataDir, timestamp)
@@ -43,7 +43,7 @@ func composeAction(ctx context.Context, conf config.ClientConfig, postAction com
})
}
-func openEditor(editor, filePath string, cb func() error) tea.Cmd {
+func openEditorCmd(editor, filePath string, cb func() error) tea.Cmd {
return tea.ExecProcess(exec.Command(editor, filePath), func(err error) tea.Msg {
return finishedMsg{
cb: cb,