mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-08 14:18:26 +02:00
Cleanup some code
This commit is contained in:
@@ -203,7 +203,11 @@ func unescape_metadata_value(k, x string) (ans string) {
|
||||
|
||||
func encode_bytes(metadata map[string]string, payload []byte) string {
|
||||
ans := strings.Builder{}
|
||||
ans.Grow(2048)
|
||||
enc_payload := ""
|
||||
if len(payload) > 0 {
|
||||
enc_payload = base64.StdEncoding.EncodeToString(payload)
|
||||
}
|
||||
ans.Grow(2048 + len(enc_payload))
|
||||
ans.WriteString("\x1b]")
|
||||
ans.WriteString(OSC_NUMBER)
|
||||
ans.WriteString(";")
|
||||
@@ -217,7 +221,7 @@ func encode_bytes(metadata map[string]string, payload []byte) string {
|
||||
}
|
||||
if len(payload) > 0 {
|
||||
ans.WriteString(";")
|
||||
ans.WriteString(base64.StdEncoding.EncodeToString(payload))
|
||||
ans.WriteString(enc_payload)
|
||||
}
|
||||
ans.WriteString("\x1b\\")
|
||||
return ans.String()
|
||||
|
||||
@@ -222,8 +222,6 @@ func run_set_loop(opts *Options, args []string) (err error) {
|
||||
return fmt.Errorf("Could not guess MIME type for %s use the --mime option to specify a MIME type", arg)
|
||||
}
|
||||
to_process[i] = inputs[i]
|
||||
if to_process[i].is_stream {
|
||||
}
|
||||
}
|
||||
return write_loop(to_process, opts)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user