mirror of
https://github.com/Maks1mS/bubbles.git
synced 2025-10-15 07:34:52 +03:00
Rename var in deleteWordRight in textinput for additional clarity
This commit is contained in:
@@ -459,7 +459,7 @@ func (m *Model) deleteWordRight() bool {
|
|||||||
return m.deleteAfterCursor()
|
return m.deleteAfterCursor()
|
||||||
}
|
}
|
||||||
|
|
||||||
i := m.pos
|
oldPos := m.pos
|
||||||
m.setCursor(m.pos + 1)
|
m.setCursor(m.pos + 1)
|
||||||
for unicode.IsSpace(m.value[m.pos]) {
|
for unicode.IsSpace(m.value[m.pos]) {
|
||||||
// ignore series of whitespace after cursor
|
// ignore series of whitespace after cursor
|
||||||
@@ -479,12 +479,12 @@ func (m *Model) deleteWordRight() bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if m.pos > len(m.value) {
|
if m.pos > len(m.value) {
|
||||||
m.value = m.value[:i]
|
m.value = m.value[:oldPos]
|
||||||
} else {
|
} else {
|
||||||
m.value = append(m.value[:i], m.value[m.pos:]...)
|
m.value = append(m.value[:oldPos], m.value[m.pos:]...)
|
||||||
}
|
}
|
||||||
|
|
||||||
return m.setCursor(i)
|
return m.setCursor(oldPos)
|
||||||
}
|
}
|
||||||
|
|
||||||
// wordLeft moves the cursor one word to the left. Returns whether or not the
|
// wordLeft moves the cursor one word to the left. Returns whether or not the
|
||||||
|
Reference in New Issue
Block a user