The scale between scaled and unscaled offsets was only calculated for
positive deltas, so when scrolling up or left it stayed at zero (or stale from
a previous scroll), causing momentum events to have zero offsets.
Closes#10610
Turn glfw touch events into mouse and scroll events. A tap is a left
click where the finger landed, a finger that moves scrolls through the
glfw momentum scroller so it coasts like touchpad scrolling, and a
finger held still before it moves drags the left button, selecting
text. Only the first finger of a sequence is used. Touch events are
printed by --debug-input.
The compensatory padding at the left and right of a window extends alongside
its title bar, but the padding shader only drew it alongside the rows of the
terminal screen, leaving the strips beside the title bar unpainted. Draw them
when rendering the title bar, colored to match the neighboring title bar cell.
Draw the compensatory padding (the pixels left over after fitting whole
cells) inside the window border instead of outside it, so the border is
always exactly one margin inside the area allocated to the window. Windows
that share an allocation edge now share a frame edge and all gaps are the
sum of the neighboring margins. Cell counts and content positions are
unchanged. Mouse hit testing includes the compensatory padding.
Move the compensatory padding away from the window title bar so the title
bar is always flush with the border, computing blank rects from the final
window geometries at the end of a layout pass.
Add the collapse_window_margins option to have the margins of neighboring
windows collapse into each other.
Fix the Grid layout not recording compensatory padding and ignoring
vertical placement_strategy values.
Based on #10508 without needing a constraint solver.
Allow creating docked windows with percentage or fixed sizes at any edge of a
window or tab. Fixes#2391
Also close#10506 and close#10508
The approach in #10506 was not used for several reasons.
1) Performance: this PR costs nothing when docs are unused vs several
milliseconds for the cassowary based approach
2) Way less code (700 lines total): No complicated solver (2K lines of code) needed
3) No risk behaviour changes for without docks
Follow up to the merge of PR #10560 which skips input_delay when less
than 1 KiB of program output is pending.
Fix a data race: the I/O thread called
vt_parser_pending_input_is_interactive() which read read.pos under the
parser lock, but the main thread modifies read.pos without the lock
while parsing, so taking the lock on one side only did not protect it.
Instead, vt_parser_commit_write() now returns whether the pending input
is small, computed from read.sz and write.pending, which are only
modified with the lock held. This may overestimate while a parse is in
progress or when an incomplete escape code is retained, in which case
we simply fall back to the normal input_delay behavior. It also saves a
lock/unlock cycle per read in the I/O thread.
Bound the number of early main loop wakeups: since render() bypasses
repaint_delay whenever input was read, input_delay was the effective
cap on parse/render frequency for streaming output. Waking the main
loop on every small read removed that cap entirely for programs that
emit a continuous stream of small writes, costing CPU and increasing
the chance of drawing partial screen updates. Now an early wakeup is
only allowed if the previous wakeup was not itself early, so typed
character echo is still delivered immediately while streams of small
writes get at most two wakeups per input_delay.
Replace the magic 1024 with SMALL_PENDING_INPUT_THRESHOLD, rename
pending_input_is_interactive() to pending_input_is_small() since the
check has nothing to do with interactivity, clarify the input_delay
option documentation and add a changelog entry.
find_matches_in_lines was passing the exclusive end offset of a match to
find_pos, so a match ending at the end of the joined screen lines mapped
to no line and was dropped. It was not highlighted, not counted and n/N
skipped it. Since screen lines are not padded, this hit any match on the
last character of a line, for example searching for foo in "x := foo".
Look up the line holding the last matched byte instead.
regexp2 backtracks on the path pattern, retrying it at every position
of a long line that has no spaces, so the path and linenum types took
seconds on a screen full of such text (about 36s for a 380x100 window
of hex). The builtin patterns dont need lookarounds, so use the linear
time stdlib engine for them. User supplied --regex patterns stay on
regexp2 so lookarounds keep working (#6265).
- Dropping a tab on the tab bar always re-orders. Only windows are merged
into a tab when dropped on its middle. Single window tabs still switch
tabs on hover so they can be dropped into the content area.
- Draw the vertical insertion marker in the blank line between tabs so it
does not hide a tab title, using a single cell only when crowded.
- Make the dropped tab active after a drop from another OS Window, instead
of whichever tab ended up at the stale active index after re-ordering.
- Dropping the window of a single window tab at an insertion point moves
its tab, preserving title and layout, and is a no-op next to itself.
- Do not leave an empty tab behind if moving a dropped window fails.
- Highlight the new tab button only when appending.
- Unify the window and tab drag hover state and share the tab bar drop
hit testing code.