Skip to content

Commit 80f4040

Browse files
committed
fix: write was not compiling
1 parent 29af117 commit 80f4040

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

write/write.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,7 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
137137
m.submitted = true
138138
return m, tea.Quit
139139
case key.Matches(msg, km.OpenInEditor):
140-
//nolint: gosec
141-
return m, createTempFile(m.textarea.Value(), uint(m.textarea.Line())+1)
140+
return m, createTempFile(m.textarea.Value(), m.textarea.Line()+1)
142141
}
143142
}
144143

@@ -149,15 +148,15 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
149148

150149
type startEditorMsg struct {
151150
path string
152-
lineno uint
151+
lineno int
153152
}
154153

155154
type editorFinishedMsg struct {
156155
content string
157156
err error
158157
}
159158

160-
func createTempFile(content string, lineno uint) tea.Cmd {
159+
func createTempFile(content string, lineno int) tea.Cmd {
161160
return func() tea.Msg {
162161
f, err := os.CreateTemp("", "gum.*.md")
163162
if err != nil {
@@ -175,7 +174,7 @@ func createTempFile(content string, lineno uint) tea.Cmd {
175174
}
176175
}
177176

178-
func openEditor(path string, lineno uint) tea.Cmd {
177+
func openEditor(path string, lineno int) tea.Cmd {
179178
cb := func(err error) tea.Msg {
180179
if err != nil {
181180
return editorFinishedMsg{

0 commit comments

Comments
 (0)