When printing and line-breaking a string in CellBuffer::write_string(),
the line should continue from the "beginning" of the previous one.
However it might be different than the offset of the first character of
the string, because it may be indented already.
This would result in awkward line breaks like:
Available actions: [ list- |# end of terminal/border
post, list-unsubscribe, lis|
t-archive ]
This commit adds an extra argument to write_string() to specify the x
offset of the string, so that we can apply it while printing characters
but ignore it when the line changes; then the x coordinate will take the
value of the line_break value.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
meli/melib are UTF8 software, so we should have proper Unicode support.
A compile-time env var is added, `UNICODE_REGENERATE_TABLES` to force
network access and rebuild the cached unicode tables.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
Store children process metadata. Pid and command lines can then be shown
in the UI and in logs.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
Make Screen generic over its display kind: Screen<Tty> and
Screen<Virtual>. The latter is for "cached" renderings we want to keep
and copy to the actual screen when the Component::draw() method is
called. Only Screen<Tty> can write to stdout and it needs an stdout
handle.
Add a generation integer field to Screen, that changes each time it is
resized. This way, we can track if "stale" areas are used and panic on
runtime (in debug mode).
Introduce a new type, Area, that keeps metadata about a subsection of a
Screen, and the generation it came from. New areas can only be created
from a Screen and by operating on an Area to create subsections of it.
This way, it's impossible to make an area refer to (x, y) cells outside
the screen generation of its provenance. If stabilised this API should
eliminate all out of bounds accesses in CellBuffers.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
This binary was included in the meli crate distribution which wasn't
intended. It's for development purposes only.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
This dependency is necessary, though for some reason the build doesn't
always fail if it's not specified.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
change_color() predated addition of Cell Attributes (Bold, Underline,
etc) so it didn't accept an attribute argument.
This commit adds a change_theme() function that does the same thing as
change_color() but also sets the cell attributes. It also takes a
ThemeAttribute as an argument instead of {fg, bg, attrs} individually.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
compose-hooks run before submitting an e-mail.
They perform draft validation and/or transformations.
If a hook encounters an error or warning, it will show up as a notification.
The currently available hooks are:
- past-date-warn
Warn if Date header value is far in the past or future.
- important-header-warn
Warn if important headers (From, Date, To, Cc, Bcc) are missing or invalid.
- missing-attachment-warn
Warn if Subject, draft body mention attachments but they are missing.
- empty-draft-warn
Warn if draft has no subject and no body.
They can be disabled with [composing.disabled_compose_hooks] setting.
- Add character attribute support
- Add cursor key mode support
- Fix buggy set fg / bg sequences
And added a bin under tools to test arbitrary apps using the embedded
terminal:
cargo run -p tools --bin embed -- "htop" 2> .htop.debug.log