mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-23 08:47:47 +02:00
...
This commit is contained in:
@@ -328,14 +328,11 @@ func (self *Term) WriteString(b string) (int, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (self *Term) DebugPrintln(a ...any) {
|
func (self *Term) DebugPrintln(a ...any) {
|
||||||
msg := []byte(fmt.Sprintln(a...))
|
msg := fmt.Appendln(nil, a...)
|
||||||
const limit = 2048
|
const limit = 2048
|
||||||
encoded := make([]byte, limit*2)
|
encoded := make([]byte, limit*2)
|
||||||
for i := 0; i < len(msg); i += limit {
|
for i := 0; i < len(msg); i += limit {
|
||||||
end := i + limit
|
end := min(i+limit, len(msg))
|
||||||
if end > len(msg) {
|
|
||||||
end = len(msg)
|
|
||||||
}
|
|
||||||
chunk := msg[i:end]
|
chunk := msg[i:end]
|
||||||
encoded = encoded[:cap(encoded)]
|
encoded = encoded[:cap(encoded)]
|
||||||
base64.StdEncoding.Encode(encoded, chunk)
|
base64.StdEncoding.Encode(encoded, chunk)
|
||||||
|
|||||||
Reference in New Issue
Block a user