Add the no_zwj measurement method which measures the same as unicode,
but strips all ZWJs from the input string. This mimics how Kitty
measures graphemes
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
- Added standard .gitattributes file for Zig projects.
- Reworked build.zig a little, hopefully it's a bit clearer. Also, now zig build will run all steps.
- outer: while in examples was redundant since there's only one loop to break from. switch expressions don't allow breaking from them, so breaking is only for loops, i.e. while and for.
- When returning a struct instance from a function, the compiler infers the return type from function signature, so instead of return MyType{...}; , it's more idiomatic to write return .{...};.
- Logging adds a new line by default, so you don't usually need to write \n like here: log.debug("event: {}\r\n", .{event});.
When linking lib_c, os.system gets overwritten with std.c. The linux
implementation of std.c doesn't contain the constants we need.
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
There will only ever be a handful of image implementations. Let's just
use a union enum for handling them.
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
As a pretty large optimization, use the provided width when possible to
avoid measuring glyphs each render
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
This query has a response that interferes with key f4. We need to fix
that parsing before doing sixel queries, and we don't even support
sixels yet.
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Implement our own grapheme measuring function which switches on whether
the terminal supports mode 2027
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Now that DA1 parsing is done, block the queryTerminal function until the
DA1 response is received, or a 1 second timeout elapses. With this
functionality, move certain events into Vaxis's realm of handling: IE
enabling kitty keyboard, unicode mode, etc
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
This doesn't handle each case yet, I'm not certain that the rest of the
logic I have in go-vaxis is correct so I want to sit on it some more
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
We use two screens: one which the user provides a slice of bytes for the
graphemes, and the user owns the bytes. We copy those bytes to our
internal model so that we can compare between frames
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>