Vi-style editor and other editor improvements (#40)

* WIP VI wrapper for editor

* WIP: block cursor

* Create Edit trait, run CI on all feature options

* Add prints describing build steps to ci.sh

* Custom rendering for Vi editor

* Clippy fixes

* More clippy fixes

* Show clippy results in CI

* Fix for Redox

* Fix clippy lint

* Add vi feature to enable vi-style editor

* Add escape to libcosmic text box
This commit is contained in:
Jeremy Soller 2022-11-15 12:26:59 -07:00 committed by GitHub
parent 271ca5cf7a
commit ee54e7626b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
33 changed files with 982 additions and 616 deletions

View file

@ -12,7 +12,7 @@ use crate::{CacheKey, Color, FontSystem};
pub use swash::scale::image::{Content as SwashContent, Image as SwashImage};
fn swash_image<'a>(font_system: &'a FontSystem, context: &mut ScaleContext, cache_key: CacheKey) -> Option<SwashImage> {
fn swash_image(font_system: &FontSystem, context: &mut ScaleContext, cache_key: CacheKey) -> Option<SwashImage> {
let font = match font_system.get_font(cache_key.font_id) {
Some(some) => some,
None => {
@ -61,7 +61,7 @@ impl<'a> SwashCache<'a> {
/// Create a new swash cache
pub fn new(font_system: &'a FontSystem) -> Self {
Self {
font_system: font_system,
font_system,
context: ScaleContext::new(),
image_cache: Map::new()
}
@ -101,7 +101,7 @@ impl<'a> SwashCache<'a> {
y + off_y,
Color(
((image.data[i] as u32) << 24) |
base.0 & 0xFFFFFF
base.0 & 0xFF_FF_FF
)
);
i += 1;