Also make lists and dicts of strings escape code safe

This commit is contained in:
Kovid Goyal
2022-12-12 19:24:44 +05:30
parent aac57550c9
commit 902373ed20
4 changed files with 27 additions and 7 deletions

View File

@@ -6,14 +6,14 @@ import (
"kitty/tools/utils"
)
func parse_key_val_args(args []string) map[string]string {
ans := make(map[string]string, len(args))
func parse_key_val_args(args []string) map[escaped_string]escaped_string {
ans := make(map[escaped_string]escaped_string, len(args))
for _, arg := range args {
key, value, found := utils.Cut(arg, "=")
if found {
ans[key] = value
ans[escaped_string(key)] = escaped_string(value)
} else {
ans[key+"="] = ""
ans[escaped_string(key+"=")] = ""
}
}
return ans