Skip to content

Commit

Permalink
fix: remove temp file after opening external editor in Text field (c…
Browse files Browse the repository at this point in the history
  • Loading branch information
auvred authored and ardnew committed Apr 9, 2024
1 parent 244cf5a commit 6539b3f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions field_text.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ func (t *Text) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
_ = os.WriteFile(tmpFile.Name(), []byte(t.textarea.Value()), os.ModePerm)
cmds = append(cmds, tea.ExecProcess(cmd, func(error) tea.Msg {
content, _ := os.ReadFile(tmpFile.Name())
_ = os.Remove(tmpFile.Name())
return updateValueMsg(content)
}))
case key.Matches(msg, t.keymap.Next, t.keymap.Submit):
Expand Down

0 comments on commit 6539b3f

Please sign in to comment.