mirror of
https://github.com/junegunn/fzf.git
synced 2026-07-09 18:19:13 +08: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:
+3
-1
@@ -6844,7 +6844,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 {
|
||||
|
||||
Reference in New Issue
Block a user