mirror of
https://github.com/junegunn/fzf.git
synced 2026-08-08 00:48:37 +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()
|
t.mutex.Unlock()
|
||||||
return false
|
return false
|
||||||
case actBracketedPasteBegin:
|
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
|
t.pasting = ¤t
|
||||||
case actBracketedPasteEnd:
|
case actBracketedPasteEnd:
|
||||||
if t.pasting != nil {
|
if t.pasting != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user