Skip to content
Myr

Copy input snapshot on bracketed paste begin

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

[]rune(t.input) is a same-type conversion that aliases t.input; in-place query edits during the paste corrupt the snapshot and skew the paste-end comparison.

authored by Junegunn Choi · committed by Junegunn Choi · parent 978ded5 · Browse files · 1 file+3 added−1 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+3 added−1 removed

  • other:+3 added−1 removed

1 file+3 added−1 removed

modified:src/terminal.go+3 added-1 removed
6883 unmodified lines
6884 case actInvalid:6885 t.mutex.Unlock()6886 return false6887 case actBracketedPasteBegin:6888 // Clone: []rune(t.input) would alias t.input, and in-place6889 // query edits during the paste would corrupt the snapshot6888 current := []rune(t.input)6890 current := slices.Clone(t.input)6891 t.pasting = &current6892 case actBracketedPasteEnd:6893 if t.pasting != nil {6894 queryChanged = string(t.input) != string(*t.pasting)
1673 unmodified lines