mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-06 01:05:48 +02:00
Handle variable fonts like cascadia code that dont have a postfix variation prefix name for some of their faces
This commit is contained in:
@@ -17,6 +17,7 @@ package shlex
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"kitty/tools/utils"
|
||||
"strings"
|
||||
"unicode/utf8"
|
||||
)
|
||||
@@ -182,6 +183,16 @@ func Split(s string) (ans []string, err error) {
|
||||
return
|
||||
}
|
||||
|
||||
func Quote(s string) string {
|
||||
if s == "" {
|
||||
return s
|
||||
}
|
||||
if utils.MustCompile(`[^\w@%+=:,./-]`).MatchString(s) {
|
||||
return "'" + strings.ReplaceAll(s, "'", "'\"'\"'") + "'"
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
// SplitForCompletion partitions a string into a slice of strings. It differs from Split in being
|
||||
// more relaxed about errors and also adding an empty string at the end if s ends with a Space.
|
||||
func SplitForCompletion(s string) (argv []string, position_of_last_arg int) {
|
||||
|
||||
Reference in New Issue
Block a user