Files
FWS-Kitty/tools/cmd/at/set_font_size.go
T
BlackAngelTV 3d174c45a4 chore: import official kitty sources from upstream
Bring the kovidgoyal/kitty codebase in as the base of FWS-Kitty, vendored at upstream commit 91fb38a without its git history.
2026-11-04 11:35:59 +01:00

22 lines
439 B
Go

// License: GPLv3 Copyright: 2022, Kovid Goyal, <kovid at kovidgoyal.net>
package at
import (
"bytes"
"strconv"
)
func parse_set_font_size(arg string, payload *set_font_size_json_type) error {
if len(arg) > 0 && (bytes.IndexByte([]byte{'+', '-', '/', '*'}, arg[0]) > -1) {
payload.Increment_op = arg[:1]
arg = arg[1:]
}
val, err := strconv.ParseFloat(arg, 64)
if err != nil {
return err
}
payload.Size = val
return nil
}