Before this change, scrolling down when there were multiple layout lines, that rendered beyond the screen, would not work properly. This is because the current logic only acts if there are two or more buffer lines, calculating the proper layout height for each line.
This adds an edge case check for single lines, ensuring the case is handled.
A combination of some ideas:
* Try all Monospace fonts before giving up.
* Relax exact weight restriction on font matching when trying Monospace
fall-back. Try smaller weights if needed.
* Make the fall-back try order weight-offset aware, AND script-aware.
* And finally, add the option to adjust the font size of glyphs using
fall-back Monospace fonts, so the width of them matches the default
font width.
For my use-case, the current fall-back attempt always fails with
Arabic script. And none of the Arabic-supporting Monospace fonts in
my system also support medium weight. So, if my default font is set
to medium weight, script-aware fall-back alone will still not work.
Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
- Scroll is identified by line index and layout index, instead of just
layout index
- Shaping has the option to prune, where caches outside of the scroll
view are cleared
- Syntax editor no longer requires layout of all lines, only of lines
inside scroll
- BufferLine has a metadata field that can be used by other abstractions
to know when text was changed
This commit adds a new ShapeBuffer type, which contains some buffers tha
are commonly re-created during the shaping process. New APIs are added
that take this structure, and old APIs are turned into wrappers around
the new API.
The goal is to reduce the number of per-layout allocations that happen
in a typical layout call.