mirror of
https://github.com/junegunn/fzf.git
synced 2026-08-13 12:33:44 +02:00
Copy input snapshot on bracketed paste begin
[]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.
This commit is contained in:
parent
978ded5cd0
commit
a1fb01462d
1 changed files with 3 additions and 1 deletions
|
|
@ -6885,7 +6885,9 @@ func (t *Terminal) Loop() error {
|
|||
t.mutex.Unlock()
|
||||
return false
|
||||
case actBracketedPasteBegin:
|
||||
current := []rune(t.input)
|
||||
// Clone: []rune(t.input) would alias t.input, and in-place
|
||||
// query edits during the paste would corrupt the snapshot
|
||||
current := slices.Clone(t.input)
|
||||
t.pasting = ¤t
|
||||
case actBracketedPasteEnd:
|
||||
if t.pasting != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue