With commit 7c5d5440e5, it became
possible that `update_colors()` may run without being immediately
followed by an `update()`. But `update_colors()` creates a new
`metadata_set`, which means `attr_list` may now contain out-of-date
metadata indices to the old cleared `metadata_set`.
With this commit:
* A `metadata_set` is only cleared and recreated in `update_colors()`
if default colors have actually changed.
* A `bool` is returned and set it to `true` from `update_colors()` if
a color update happened.
* An `update()` is run if we get a `true` from `update_colors()`.
* And finally, `update_colors()` is renamed to
`update_default_colors()`.
Fixes#291.
Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
Replace '\t' with a space in text buffers, as tab skip/stop is handled
by `alacritty_terminal`.
Also, sending a tab to the shaper causes issues, as fonts either have
no tab codepoint, or worse, some do, with the glyph produced being
anyone's guess. Some may render a tab to some random character like
'0'.
Fixes#73.
Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
Make use of the addition to cosmic-text that allows matching
the widths of fallback Monospace fonts to the default one.
Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
* Add `Metadata` struct to pass bg, underline_color, and flags info via
metadata.
* Keep and `IndexSet` of `Metadata` info in Terminal.
* Use `Metadata` info to render STRIKEOUT, UNDERCURL, and all underline
styles via `BgRect`.
Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
* Add a color deriver and derive dim colors for all themes.
* Derive actual bright colors for the OneHalfDark theme while at it.
* Use dim colors when the DIM flag is set.
Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
This zero-width char will force the shaper to treat detected RTL
lines as LTR.
RTL text would still be rendered correctly. But this fixes the wrong
behavior of it being displayed aligned to the right.
Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>