yes, sorry, was actually quite well formatted (clang-format default) ... but its probably just me working on the code ever. So, i will just use my preferences here.
I find it important. visual guy and all other excuses...
Highlights all the output message operators when banged.
The H operator shouldn't have an output port but a right-side-locked
port type, and has been modified.
The 'tool' build script previously required bash. This commit changes it
to need only POSIX sh, which removes a dependency from the project. bash
is a bit easier to work with than POSIX sh, but the trade-off seems
worth it in this case. We already require POSIX, so we're guaranteed to
have access to POSIX sh. Some systems may not have bash.
As an added bonus, the startup time of the script will probably be
slightly faster by a few milliseconds, because some implementations like
dash start up faster than bash.
One downside is that POSIX sh doesn't have a built-in for 'time', and
one of my testing environments, a stripped-down Ubuntu image, didn't
have 'time' installed by default. I believe 'time' is mandatory in
POSIX, so that's a bit strange. I think this might be a common thing, so
I added a case to handle it in the 'tool' script, instead of having the
script fail.
Previously, the Qnav blocks (the menu panels) would have their position
determined once when they're first created, and then never updated. The
positioning of Qnav blocks is determined by some code that may cause the
blocks to wrap or be positioned differently depending on how much screen
space is available. For example, if you open a nested menu that's three
blocks/panels deep, and the third panel doesn't have enough room on the
right in the terminal, it may be shown below the second panel instead of
to the right.
This had a flaw. If the user resized their terminal after the menus were
already open, the positions of the menu panels wouldn't be adjusted to
accommodate the new screen size. There wasn't a way to trigger a full
re-layout of all the menu items when the terminal was resized.
This commit adds qnav_adjust_term_size(), which is called from
tui_main.c when the terminal is resized. This function will re-layout
the menu panels.
An oversight in the implementation of J and Y meant that the chain would
grow each frame, if there were at least two segments and the first
segment was locked by something like H. Example:
H
YY
This is not what we want. I've added a guard in the J and Y
implementations that checks if the glyph above (or for Y, to the left)
is an earlier part of the chain, and if it is, to return. This has the
downside of making long chains potentially having to enter the J code
repeatedly, only to end up doing nothing.
The STUN() in J and Y might no longer be worth it. It was used to
prevent further operators in the chain from running, but since we have a
guard now, the writes while looping might end up costing more time.
We don't have any good benchmark files set up right now, so we'll have
to test it in the future.
I had believed this case was working correctly, but an edit to reduce
the number of used local variables had introduced a mistake that caused
it to fail. This commit fixes the problem by overwriting the variable
where the captured output of a failed pkg-config attempt was stored with
0, so that the subsequent if branch works correctly.