mirror of
https://github.com/Maks1mS/bubbles.git
synced 2024-12-24 14:44:38 +03:00
Fix regression where cursor was misplaced after a paste
This commit is contained in:
parent
03461d6804
commit
703de11da4
@ -175,7 +175,7 @@ func (m *Model) Paste() {
|
|||||||
// Insert pasted runes
|
// Insert pasted runes
|
||||||
for _, r := range paste {
|
for _, r := range paste {
|
||||||
head = append(head, r)
|
head = append(head, r)
|
||||||
m.SetCursor(m.pos + 1)
|
m.pos++
|
||||||
if m.CharLimit > 0 {
|
if m.CharLimit > 0 {
|
||||||
availSpace--
|
availSpace--
|
||||||
if availSpace <= 0 {
|
if availSpace <= 0 {
|
||||||
@ -186,6 +186,9 @@ func (m *Model) Paste() {
|
|||||||
|
|
||||||
// Put it all back together
|
// Put it all back together
|
||||||
m.value = append(head, tail...)
|
m.value = append(head, tail...)
|
||||||
|
|
||||||
|
// Reset blink state and run overflow checks
|
||||||
|
m.SetCursor(m.pos)
|
||||||
}
|
}
|
||||||
|
|
||||||
// If a max width is defined, perform some logic to treat the visible area
|
// If a max width is defined, perform some logic to treat the visible area
|
||||||
|
Loading…
Reference in New Issue
Block a user