commits
The ScrollView will panic if scroll.y is given a number that is outside
the content size.
Refactor the tty implementations. Complete the windows implementation
If appending to a buffer through writer for example, the cols may not be
correct if the writes don't end up in a newline (\n). Fix this by
keeping track of the cols of previous append.
When stopping the loop, we never reset `should_quit` which caused the
program to not read any input if the loop were started again
Zellij doesn't support any motion at time of this commit, so we also try
to enable button motion first
Reset cursor sgr to prevent erasing the screen with some unknown
background color.
CodeView widget allows viewing code in a more visually pleasing manner.
It combines LineNumbers widget to provide line numbers on the side.
The CodeView widget allows you to optionally highlight a specific line
and show indentation guidelines.
It is not intended to be a fully fledged editor, but rather for showing
code snippets to a user.
While it is not a fully fledged editor, this widget's code can give you
a good starting point.
The TextView widget provides a simple way to show text content in
a scrollable window.
This implementation does not offer automatic line wrapping for now.
Text content is backed by the Buffer struct. The buffer can be styled
for visually appealing and colorful content, for example to provide
a syntax highlighting.
The buffer provides a writer() interface which allows providing content
from a stream, such as logging.
The LineNumbers widget draws vertical list of numbers.
This can be used as a line number bar for a text editor for example.
The ScrollView widget can be used to introduce scrollable elements into
existing widgets.
To use the ScrollView, you must use the ScrollView's writeCell and
readCell functions rather than the ones from Window.
libxev's .rearm semantics are unfortunately not very
portable---rescheduling the exact same event on macOS / kqueue seems
to cause the event loop to hang, while manually rescheduling and
returning .disarm does not.
We don't want the scope to look like it's from the xev library
The xev example is now a complete replication of the vaxis example, but
using xev as the event loop
This loop adds an xev.File wrapper called TtyWatcher which delivers
events to the users callback. Note that this implementation does not
handle any of the writes. Writes are always safe in the main thread, so
we let users decide how they will schedule those (buffered writers, xev
writes, etc)
Applications may use this to handle panics gracefully
Use single "src" element in paths to include everything under src/
The Tty.zig was renamed to tty.zig and that was not picked up
All vaxis functions that write to the terminal now require an
io.AnyWriter as a parameter
Refactor to move the tty out of the vaxis struct. All vaxis writes now
take an io.AnyWriter
Move tty state (*not* termios, though) into Vaxis struct
Refactor the parser to be more robust and easier to read.
Add support for querying colors (index, foreground, background, and
cursor)
Add a newline at the top of the loop instead of the bottom
Attempting to close /dev/tty may block indefinitely on macos if another
thread is already blocked on a read operation. As there is no practical
use for closing /dev/tty on exit besides unblocking other threads (which
does not work on macos anyway) we can just skip the close call.
This detects support for pixel mouse mode so it can be enabled only
if supported.
This also translates pixel coordinates to something more compatible
with plaine cell coordinates. This make it much easier to write
applications that support both.
CodeView widget allows viewing code in a more visually pleasing manner.
It combines LineNumbers widget to provide line numbers on the side.
The CodeView widget allows you to optionally highlight a specific line
and show indentation guidelines.
It is not intended to be a fully fledged editor, but rather for showing
code snippets to a user.
While it is not a fully fledged editor, this widget's code can give you
a good starting point.
The TextView widget provides a simple way to show text content in
a scrollable window.
This implementation does not offer automatic line wrapping for now.
Text content is backed by the Buffer struct. The buffer can be styled
for visually appealing and colorful content, for example to provide
a syntax highlighting.
The buffer provides a writer() interface which allows providing content
from a stream, such as logging.