From 760d1b7c5847c1c9782271966fe8a36bbf027818 Mon Sep 17 00:00:00 2001 From: mickychang9 Date: Mon, 29 Sep 2025 17:11:19 +0800 Subject: refactor: use maps.Copy and maps.Clone (#4518) Signed-off-by: mickychang9 --- src/terminal.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/terminal.go') diff --git a/src/terminal.go b/src/terminal.go index 4f78ab2e..d18a0ba7 100644 --- a/src/terminal.go +++ b/src/terminal.go @@ -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, -- cgit v1.2.3