m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-16 07:13:48 -05:00

refactor: use maps.Copy and maps.Clone (#4518)

Signed-off-by: mickychang9 <mickychang9@outlook.com>
This commit is contained in:
mickychang9
2025-09-29 17:11:19 +08:00
committed by GitHub
parent 9bdacc8df2
commit 760d1b7c58
3 changed files with 6 additions and 11 deletions

View File

@@ -6,6 +6,7 @@ import (
"encoding/json"
"fmt"
"io"
"maps"
"math"
"net"
"os"
@@ -950,10 +951,7 @@ func NewTerminal(opts *Options, eventBox *util.EventBox, executor *util.Executor
wordRubout = fmt.Sprintf("%s[^%s]", sep, sep)
wordNext = fmt.Sprintf("[^%s]%s|(.$)", sep, sep)
}
keymapCopy := make(map[tui.Event][]*action)
for key, action := range opts.Keymap {
keymapCopy[key] = action
}
keymapCopy := maps.Clone(opts.Keymap)
t := Terminal{
initDelay: delay,