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 29, 2024
1 parent 40f122f commit 801dedc
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 @@ -220,6 +220,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 801dedc

Please sign in to comment.