Commit Graph

31 Commits (master)

Author SHA1 Message Date
Manos Pitsidianakis ae96038fbf
Make unicode-segmentation a hard dependency
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>
3 weeks ago
Manos Pitsidianakis 3e9144657b
meli: store children process metadata
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>
1 month ago
Manos Pitsidianakis b8b24282a0
Update all instances of old domains with meli-email.org
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2 months ago
Manos Pitsidianakis e19f3e572c
Cargo-sort all Cargo.toml files
With:

cargo sort  --grouped --order package,bin,lib,dependencies,features,build-dependencies,dev-dependencies,workspace meli
cargo sort  --grouped --order package,bin,lib,dependencies,features,build-dependencies,dev-dependencies,workspace melib
cargo sort  --grouped --order package,bin,lib,dependencies,features,build-dependencies,dev-dependencies,workspace tools
cargo sort  --grouped --order package,bin,lib,dependencies,features,build-dependencies,dev-dependencies,workspace fuzz

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
5 months ago
Manos Pitsidianakis 3495ffd61b
types: Change UIEvent::Notification structure
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
5 months ago
Manos Pitsidianakis 0a74c7d0e5
terminal/embedded: overhaul refactor
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
5 months ago
Manos Pitsidianakis 0e3a0c4b70
Add safe UI widget area drawing API
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>
5 months ago
Manos Pitsidianakis 7645ff1b87
terminal/cells: rename write_string{to_grid,}
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
5 months ago
Manos Pitsidianakis e0adcdfe15
terminal/cells: move rest of methods under CellBuffer
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
5 months ago
Manos Pitsidianakis ab14f81900
terminal/cells: make write_string_to_grid a CellBuffer method
For future reference, refactoring was done with comby:

comby -review ":[w~\s]write_string_to_grid(:[s], &mut :[var],:[rest])" ":[var].write_string_to_grid(:[s],:[rest])" .rs
comby -review ":[w~\s]write_string_to_grid(:[s],:[var],:[rest])" ":[var].write_string_to_grid(:[s],:[rest])" .rs

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
5 months ago
Manos Pitsidianakis fa33a9468a
Move managesieve-client binary to tools/
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>
5 months ago
Manos Pitsidianakis 0e60bdf26e
Cargo.toml: add "iterator" feature to signal-hook
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>
5 months ago
Manos Pitsidianakis 2dc2940586
melib/build.rs: add feature to use cache instead of downloading unicode data
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
8 months ago
Manos Pitsidianakis f93adb683a
meli/terminal: replace change_color uses with change_theme
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>
9 months ago
Manos Pitsidianakis 129f10911b
melib: rename `imap_backend` feature to `imap` 9 months ago
Manos Pitsidianakis b0e867eb68
Move src to meli/src 10 months ago
Manos Pitsidianakis 0b258a1f05
meli: clippy lint fixes 10 months ago
Manos Pitsidianakis 5f29faa640
melib: clippy lint fixes 10 months ago
Manos Pitsidianakis 96537e48c5
Add {Timer,Component}Id wrapper types over Uuid 11 months ago
Manos Pitsidianakis 8f14a2373e
melib/imap: put imap-codec logic under the imap_backend feature 11 months ago
Manos Pitsidianakis e0257c9d8d
Run cargo-sort 11 months ago
Manos Pitsidianakis 299c8e0f99
meli: restructure pub use melib::* imports 11 months ago
Manos Pitsidianakis 8c671935f9
Add compose (pre-submission) hooks for validation/linting
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.
12 months ago
Manos Pitsidianakis b1a7188771
Clippy fixes 1 year ago
Manos Pitsidianakis a73885acb1 Improve embed terminal
- 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
2 years ago
Manos Pitsidianakis 721891c295 Update nom dependency 2 years ago
Manos Pitsidianakis bcca9abe66
docs: Use example.com in documentation
Closes #96
3 years ago
Manos Pitsidianakis a7c0bca8ce
Fix test errors and warnings 3 years ago
Manos Pitsidianakis 05e4dbcd5a
melib: update smol to 1.0.0 4 years ago
Manos Pitsidianakis c6c0da7fcb
melib: cleanup commit
Cleanup melib module exports, add some document tests, change some
documentation.
4 years ago
Manos Pitsidianakis 6302d9d618
Rename testing crate to tools, and add README 4 years ago