Skip to content

Commit

Permalink
Cleanup an old var
Browse files Browse the repository at this point in the history
  • Loading branch information
meowgorithm committed Jan 19, 2022
1 parent 091c915 commit 764fd32
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions textinput/textinput.go
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,6 @@ func (m *Model) deleteWordLeft() bool {
return m.deleteBeforeCursor()
}

i := m.pos
blink := m.setCursor(m.pos - 1)
for unicode.IsSpace(m.value[m.pos]) {
if m.pos <= 0 {
Expand All @@ -434,10 +433,10 @@ func (m *Model) deleteWordLeft() bool {
}
}

if i > len(m.value) {
if m.pos > len(m.value) {
m.value = m.value[:m.pos]
} else {
m.value = append(m.value[:m.pos], m.value[i:]...)
m.value = append(m.value[:m.pos], m.value[m.pos:]...)
}

return blink
Expand Down

0 comments on commit 764fd32

Please sign in to comment.