Skip to content
Myr

fix: write was not compiling

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Andrey Nering · committed by Andrey Nering · parent dfe6199 · Browse files · 1 file+4 added−5 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+4 added−5 removed

  • other:+4 added−5 removed

1 file+4 added−5 removed

modified:write/write.go+4 added-5 removed
135 unmodified lines
136 m.quitting = true137 m.submitted = true138 return m, tea.Quit139 case key.Matches(msg, km.OpenInEditor):140 //nolint: gosec141 return m, createTempFile(m.textarea.Value(), uint(m.textarea.Line())+1)140 return m, createTempFile(m.textarea.Value(), m.textarea.Line()+1)141 }142 }143144 var cmd tea.Cmd
2 unmodified lines
147}148149type startEditorMsg struct {150 path string152 lineno uint151 lineno int152}153154type editorFinishedMsg struct {155 content string156 err error157}158160func createTempFile(content string, lineno uint) tea.Cmd {159func createTempFile(content string, lineno int) tea.Cmd {160 return func() tea.Msg {161 f, err := os.CreateTemp("", "gum.*.md")162 if err != nil {163 return editorFinishedMsg{err: err}
9 unmodified lines
173 }174 }175}176178func openEditor(path string, lineno uint) tea.Cmd {177func openEditor(path string, lineno int) tea.Cmd {178 cb := func(err error) tea.Msg {179 if err != nil {180 return editorFinishedMsg{181 err: err,
21 unmodified lines