From 8661de659dc06961f036f4dc68bdadbe055d6d9f Mon Sep 17 00:00:00 2001 From: Dongdong Zhou Date: Tue, 6 Aug 2024 23:33:25 +0100 Subject: [PATCH] bump floem --- Cargo.lock | 283 ++++++++++------------------ Cargo.toml | 4 +- lapce-app/benches/visual_line.rs | 2 +- lapce-app/src/app.rs | 12 +- lapce-app/src/config/ui.rs | 2 +- lapce-app/src/doc.rs | 20 +- lapce-app/src/editor/gutter.rs | 2 +- lapce-app/src/file_explorer/view.rs | 2 +- lapce-app/src/focus_text.rs | 2 +- lapce-app/src/markdown.rs | 2 +- lapce-app/src/panel/debug_view.rs | 2 +- lapce-app/src/settings.rs | 2 +- lapce-app/src/terminal/view.rs | 2 +- lapce-app/src/text_area.rs | 2 +- lapce-app/src/text_input.rs | 2 +- lapce-app/src/window_tab.rs | 2 +- lapce-core/src/language.rs | 6 +- 17 files changed, 130 insertions(+), 219 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0e974ad289..1d3d304e62 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -88,12 +88,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "aliasable" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "250f629c0161ad8107cf89319e990051fae62832fd343083bea452d93e2205fd" - [[package]] name = "allocator-api2" version = "0.2.16" @@ -387,15 +381,6 @@ dependencies = [ "syn 2.0.57", ] -[[package]] -name = "atomic" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d818003e740b63afc82337e3160717f4f63078720a810b7b903e70a5d1d2994" -dependencies = [ - "bytemuck", -] - [[package]] name = "atomic-waker" version = "1.1.2" @@ -990,6 +975,29 @@ dependencies = [ "libc", ] +[[package]] +name = "cosmic-text" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59fd57d82eb4bfe7ffa9b1cec0c05e2fd378155b47f255a67983cb4afe0e80c2" +dependencies = [ + "bitflags 2.6.0", + "fontdb", + "log", + "rangemap", + "rayon", + "rustc-hash", + "rustybuzz 0.14.1", + "self_cell", + "swash", + "sys-locale", + "ttf-parser 0.21.1", + "unicode-bidi", + "unicode-linebreak", + "unicode-script", + "unicode-segmentation", +] + [[package]] name = "cpp_demangle" version = "0.3.5" @@ -1591,8 +1599,6 @@ dependencies = [ "concurrent-queue", "parking", "pin-project-lite", - "portable-atomic", - "portable-atomic-util", ] [[package]] @@ -1678,7 +1684,7 @@ checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4" [[package]] name = "floem" version = "0.1.1" -source = "git+https://github.com/lapce/floem?rev=720e360500582704303c812c1ed78c98048b5428#720e360500582704303c812c1ed78c98048b5428" +source = "git+https://github.com/lapce/floem?rev=48d2b6eb22a02a100d67868052ecc35fa3c42e10#48d2b6eb22a02a100d67868052ecc35fa3c42e10" dependencies = [ "bitflags 2.6.0", "copypasta", @@ -1713,35 +1719,10 @@ dependencies = [ "wgpu", ] -[[package]] -name = "floem-cosmic-text" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "275b8b99e4cb052beeea4ea35d1ce21810dda584945c0e71778b64e516994ea1" -dependencies = [ - "fontdb", - "libm", - "log", - "once_cell", - "ouroboros", - "parking_lot", - "peniko", - "rangemap", - "rustybuzz", - "stretto", - "swash", - "sys-locale", - "ttf-parser 0.20.0", - "unicode-bidi", - "unicode-linebreak", - "unicode-script", - "unicode-segmentation", -] - [[package]] name = "floem-editor-core" version = "0.1.1" -source = "git+https://github.com/lapce/floem?rev=720e360500582704303c812c1ed78c98048b5428#720e360500582704303c812c1ed78c98048b5428" +source = "git+https://github.com/lapce/floem?rev=48d2b6eb22a02a100d67868052ecc35fa3c42e10#48d2b6eb22a02a100d67868052ecc35fa3c42e10" dependencies = [ "bitflags 2.6.0", "itertools 0.12.1", @@ -1755,12 +1736,12 @@ dependencies = [ [[package]] name = "floem-vger" -version = "0.2.9" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6398d65ceaf70cea1c156c0781c4858f34befc498d52cf397ac6ee59a4f55fde" +checksum = "d384ed3dafa48c991166ed519da1a26dc3324ada418cd966f59a0770255e2518" dependencies = [ + "cosmic-text", "euclid", - "floem-cosmic-text", "fontdue", "rect_packer", "wgpu", @@ -1819,7 +1800,7 @@ dependencies = [ [[package]] name = "floem_reactive" version = "0.1.1" -source = "git+https://github.com/lapce/floem?rev=720e360500582704303c812c1ed78c98048b5428#720e360500582704303c812c1ed78c98048b5428" +source = "git+https://github.com/lapce/floem?rev=48d2b6eb22a02a100d67868052ecc35fa3c42e10#48d2b6eb22a02a100d67868052ecc35fa3c42e10" dependencies = [ "smallvec", ] @@ -1827,10 +1808,11 @@ dependencies = [ [[package]] name = "floem_renderer" version = "0.1.1" -source = "git+https://github.com/lapce/floem?rev=720e360500582704303c812c1ed78c98048b5428#720e360500582704303c812c1ed78c98048b5428" +source = "git+https://github.com/lapce/floem?rev=48d2b6eb22a02a100d67868052ecc35fa3c42e10#48d2b6eb22a02a100d67868052ecc35fa3c42e10" dependencies = [ - "floem-cosmic-text", + "cosmic-text", "image", + "parking_lot", "peniko", "resvg", ] @@ -1838,7 +1820,7 @@ dependencies = [ [[package]] name = "floem_tiny_skia_renderer" version = "0.1.1" -source = "git+https://github.com/lapce/floem?rev=720e360500582704303c812c1ed78c98048b5428#720e360500582704303c812c1ed78c98048b5428" +source = "git+https://github.com/lapce/floem?rev=48d2b6eb22a02a100d67868052ecc35fa3c42e10#48d2b6eb22a02a100d67868052ecc35fa3c42e10" dependencies = [ "anyhow", "bytemuck", @@ -1855,7 +1837,7 @@ dependencies = [ [[package]] name = "floem_vger_renderer" version = "0.1.1" -source = "git+https://github.com/lapce/floem?rev=720e360500582704303c812c1ed78c98048b5428#720e360500582704303c812c1ed78c98048b5428" +source = "git+https://github.com/lapce/floem?rev=48d2b6eb22a02a100d67868052ecc35fa3c42e10#48d2b6eb22a02a100d67868052ecc35fa3c42e10" dependencies = [ "anyhow", "floem-vger", @@ -1877,9 +1859,9 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "font-types" -version = "0.5.2" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd6784a76a9c2b136ea3b8462391e9328252e938eb706eb44d752723b4c3a533" +checksum = "8f0189ccb084f77c5523e08288d418cbaa09c451a08515678a0aa265df9a8b60" dependencies = [ "bytemuck", ] @@ -2154,10 +2136,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" dependencies = [ "cfg-if", - "js-sys", "libc", "wasi", - "wasm-bindgen", ] [[package]] @@ -3745,31 +3725,6 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "ouroboros" -version = "0.18.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b7be5a8a3462b752f4be3ff2b2bf2f7f1d00834902e46be2a4d68b87b0573c" -dependencies = [ - "aliasable", - "ouroboros_macro", - "static_assertions", -] - -[[package]] -name = "ouroboros_macro" -version = "0.18.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b645dcde5f119c2c454a92d0dfa271a2a3b205da92e4292a68ead4bdbfde1f33" -dependencies = [ - "heck", - "itertools 0.12.1", - "proc-macro2", - "proc-macro2-diagnostics", - "quote", - "syn 2.0.57", -] - [[package]] name = "overload" version = "0.1.1" @@ -3954,21 +3909,6 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22686f4785f02a4fcc856d3b3bb19bf6c8160d103f7a99cc258bddd0251dc7f2" -[[package]] -name = "portable-atomic" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" - -[[package]] -name = "portable-atomic-util" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1a7411625b38d51b41421c6333976adffd4674a925a978856734a2dc853449b" -dependencies = [ - "portable-atomic", -] - [[package]] name = "powerfmt" version = "0.2.0" @@ -4006,19 +3946,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "proc-macro2-diagnostics" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.57", - "version_check", - "yansi", -] - [[package]] name = "profiling" version = "1.0.10" @@ -4128,9 +4055,9 @@ checksum = "9c8a99fddc9f0ba0a85884b8d14e3592853e787d581ca1816c91349b10e4eeab" [[package]] name = "rangemap" -version = "1.3.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9283c6b06096b47afc7109834fdedab891175bb5241ee5d4f7d2546549f263" +checksum = "f60fcc7d6849342eff22c4350c8b9a989ee8ceabc4b481253e8946b9fe83d684" [[package]] name = "raw-window-handle" @@ -4166,9 +4093,9 @@ dependencies = [ [[package]] name = "read-fonts" -version = "0.19.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea75b5ec052843434d263ef7a4c31cf86db5908c729694afb1ad3c884252a1b6" +checksum = "8c141b9980e1150201b2a3a32879001c8f975fe313ec3df5471a9b5c79a880cd" dependencies = [ "bytemuck", "font-types", @@ -4442,11 +4369,27 @@ checksum = "f0ae5692c5beaad6a9e22830deeed7874eae8a4e3ba4076fb48e12c56856222c" dependencies = [ "bitflags 2.6.0", "bytemuck", - "libm", "smallvec", "ttf-parser 0.20.0", - "unicode-bidi-mirroring", - "unicode-ccc", + "unicode-bidi-mirroring 0.1.0", + "unicode-ccc 0.1.2", + "unicode-properties", + "unicode-script", +] + +[[package]] +name = "rustybuzz" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfb9cf8877777222e4a3bc7eb247e398b56baba500c38c1c46842431adc8b55c" +dependencies = [ + "bitflags 2.6.0", + "bytemuck", + "libm", + "smallvec", + "ttf-parser 0.21.1", + "unicode-bidi-mirroring 0.2.0", + "unicode-ccc 0.2.0", "unicode-properties", "unicode-script", ] @@ -4500,12 +4443,6 @@ dependencies = [ "tiny-skia", ] -[[package]] -name = "seahash" -version = "4.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" - [[package]] name = "security-framework" version = "2.7.0" @@ -4529,6 +4466,12 @@ dependencies = [ "libc", ] +[[package]] +name = "self_cell" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d369a96f978623eb3dc28807c4852d6cc617fed53da5d3c400feff1ef34a714a" + [[package]] name = "semver" version = "1.0.23" @@ -4698,6 +4641,16 @@ dependencies = [ "typenum", ] +[[package]] +name = "skrifa" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abea4738067b1e628c6ce28b2c216c19e9ea95715cdb332680e821c3bec2ef23" +dependencies = [ + "bytemuck", + "read-fonts", +] + [[package]] name = "slab" version = "0.4.9" @@ -4853,24 +4806,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" -[[package]] -name = "stretto" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70a313e115c2cd9a88d99d60386bc88641c853d468b2c3bc454c294f385fc084" -dependencies = [ - "atomic", - "crossbeam-channel", - "getrandom", - "parking_lot", - "rand", - "seahash", - "thiserror", - "tracing 0.1.37", - "wg", - "xxhash-rust", -] - [[package]] name = "strict-num" version = "0.1.1" @@ -4928,11 +4863,11 @@ dependencies = [ [[package]] name = "swash" -version = "0.1.15" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ec889a8e0a6fcb91041996c8f1f6be0fe1a09e94478785e07c32ce2bca2d2b" +checksum = "93cdc334a50fcc2aa3f04761af3b28196280a6aaadb1ef11215c478ae32615ac" dependencies = [ - "read-fonts", + "skrifa", "yazi", "zeno", ] @@ -4967,15 +4902,11 @@ checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" [[package]] name = "sys-locale" -version = "0.2.4" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8a11bd9c338fdba09f7881ab41551932ad42e405f61d01e8406baea71c07aee" +checksum = "e801cf239ecd6ccd71f03d270d67dd53d13e90aab208bf4b8fe4ad957ea949b0" dependencies = [ - "js-sys", "libc", - "wasm-bindgen", - "web-sys", - "windows-sys 0.45.0", ] [[package]] @@ -5430,16 +5361,6 @@ dependencies = [ "regex", ] -[[package]] -name = "triomphe" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee8098afad3fb0c54a9007aab6804558410503ad676d4633f9c2559a00ac0f" -dependencies = [ - "serde", - "stable_deref_trait", -] - [[package]] name = "try-lock" version = "0.2.3" @@ -5458,6 +5379,12 @@ version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17f77d76d837a7830fe1d4f12b7b4ba4192c1888001c7164257e4bc6d21d96b4" +[[package]] +name = "ttf-parser" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c591d83f69777866b9126b24c6dd9a18351f177e49d625920d19f989fd31cf8" + [[package]] name = "typenum" version = "1.15.0" @@ -5496,12 +5423,24 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56d12260fb92d52f9008be7e4bca09f584780eb2266dc8fecc6a192bec561694" +[[package]] +name = "unicode-bidi-mirroring" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23cb788ffebc92c5948d0e997106233eeb1d8b9512f93f41651f52b6c5f5af86" + [[package]] name = "unicode-ccc" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cc2520efa644f8268dce4dcd3050eaa7fc044fca03961e9998ac7e2e92b77cf1" +[[package]] +name = "unicode-ccc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1df77b101bcc4ea3d78dafc5ad7e4f58ceffe0b2b16bf446aeb50b6cb4157656" + [[package]] name = "unicode-ident" version = "1.0.4" @@ -5592,7 +5531,7 @@ dependencies = [ "log", "pico-args", "roxmltree", - "rustybuzz", + "rustybuzz 0.12.1", "simplecss", "siphasher", "strict-num", @@ -6343,18 +6282,6 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9193164d4de03a926d909d3bc7c30543cecb35400c02114792c2cae20d5e2dbb" -[[package]] -name = "wg" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dadf90865f15d5c2d87f126a56ce3715b3a233641acdd10f59200aa7f4c81fb9" -dependencies = [ - "event-listener 5.2.0", - "futures-core", - "parking_lot", - "triomphe", -] - [[package]] name = "wgpu" version = "22.0.0" @@ -6986,18 +6913,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec7a2a501ed189703dba8b08142f057e887dfc4b2cc4db2d343ac6376ba3e0b9" -[[package]] -name = "xxhash-rust" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9828b178da53440fa9c766a3d2f73f7cf5d0ac1fe3980c1e5018d899fd19e07b" - -[[package]] -name = "yansi" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" - [[package]] name = "yazi" version = "0.1.6" diff --git a/Cargo.toml b/Cargo.toml index 5930a867ce..18702ae19b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -76,9 +76,9 @@ lapce-core = { path = "./lapce-core" } lapce-rpc = { path = "./lapce-rpc" } lapce-proxy = { path = "./lapce-proxy" } -floem = { git = "https://github.com/lapce/floem", rev = "720e360500582704303c812c1ed78c98048b5428", features = ["editor", "serde", "default-image-formats", "rfd-async-std"] } +floem = { git = "https://github.com/lapce/floem", rev = "48d2b6eb22a02a100d67868052ecc35fa3c42e10", features = ["editor", "serde", "default-image-formats", "rfd-async-std"] } # floem = { path = "../floem", features = ["editor", "serde", "default-image-formats", "rfd-async-std"] } -floem-editor-core = { git = "https://github.com/lapce/floem", rev = "720e360500582704303c812c1ed78c98048b5428", features = ["serde"] } +floem-editor-core = { git = "https://github.com/lapce/floem", rev = "48d2b6eb22a02a100d67868052ecc35fa3c42e10", features = ["serde"] } # floem-editor-core = { path = "../floem/editor-core/", features = ["serde"] } [patch.crates-io] diff --git a/lapce-app/benches/visual_line.rs b/lapce-app/benches/visual_line.rs index 41ab2c4aa7..ec57f3cdcd 100644 --- a/lapce-app/benches/visual_line.rs +++ b/lapce-app/benches/visual_line.rs @@ -2,8 +2,8 @@ use std::{cell::RefCell, collections::HashMap, rc::Rc, sync::Arc}; use criterion::{black_box, criterion_group, criterion_main, Criterion}; use floem::{ - cosmic_text::{Attrs, AttrsList, FamilyOwned, TextLayout, Wrap}, reactive::Scope, + text::{Attrs, AttrsList, FamilyOwned, TextLayout, Wrap}, views::editor::{ layout::TextLayoutLine, phantom_text::PhantomTextLine, diff --git a/lapce-app/src/app.rs b/lapce-app/src/app.rs index bd0d5c1380..0ebbad7c16 100644 --- a/lapce-app/src/app.rs +++ b/lapce-app/src/app.rs @@ -14,7 +14,6 @@ use clap::Parser; use crossbeam_channel::Sender; use floem::{ action::show_context_menu, - cosmic_text::{Style as FontStyle, Weight}, event::{Event, EventListener, EventPropagation}, ext_event::{create_ext_action, create_signal_from_channel}, menu::{Menu, MenuItem}, @@ -34,6 +33,7 @@ use floem::{ style_helpers::{self, auto, fr}, Line, }, + text::{Style as FontStyle, Weight}, unit::PxPctAuto, views::{ clip, container, drag_resize_window_area, drag_window_area, dyn_stack, @@ -3594,7 +3594,7 @@ pub fn launch() { #[cfg(feature = "vendored-fonts")] { - use floem::cosmic_text::{fontdb::Source, FONT_SYSTEM}; + use floem::text::{fontdb::Source, FONT_SYSTEM}; const FONT_DEJAVU_SANS_REGULAR: &[u8] = include_bytes!(concat!( env!("CARGO_MANIFEST_DIR"), @@ -3606,12 +3606,12 @@ pub fn launch() { )); FONT_SYSTEM - .db() - .write() + .lock() + .db_mut() .load_font_source(Source::Binary(Arc::new(FONT_DEJAVU_SANS_REGULAR))); FONT_SYSTEM - .db() - .write() + .lock() + .db_mut() .load_font_source(Source::Binary(Arc::new( FONT_DEJAVU_SANS_MONO_REGULAR, ))); diff --git a/lapce-app/src/config/ui.rs b/lapce-app/src/config/ui.rs index 6595c3f722..79b427b0de 100644 --- a/lapce-app/src/config/ui.rs +++ b/lapce-app/src/config/ui.rs @@ -1,4 +1,4 @@ -use floem::cosmic_text::FamilyOwned; +use floem::text::FamilyOwned; use serde::{Deserialize, Serialize}; use structdesc::FieldNames; diff --git a/lapce-app/src/doc.rs b/lapce-app/src/doc.rs index 44af611422..ad5d386485 100644 --- a/lapce-app/src/doc.rs +++ b/lapce-app/src/doc.rs @@ -14,11 +14,11 @@ use std::{ use floem::{ action::exec_after, - cosmic_text::{Attrs, AttrsList, FamilyOwned, TextLayout}, ext_event::create_ext_action, keyboard::Modifiers, peniko::Color, reactive::{batch, ReadSignal, RwSignal, Scope}, + text::{Attrs, AttrsList, FamilyOwned, TextLayout}, views::editor::{ actions::CommonAction, command::{Command, CommandExecuted}, @@ -1813,23 +1813,23 @@ impl Styling for DocStyling { &self, _: EditorId, _line: usize, - ) -> std::borrow::Cow<[floem::cosmic_text::FamilyOwned]> { + ) -> std::borrow::Cow<[floem::text::FamilyOwned]> { // TODO: cache this Cow::Owned(self.config.with_untracked(|config| { FamilyOwned::parse_list(&config.editor.font_family).collect() })) } - fn weight(&self, _: EditorId, _line: usize) -> floem::cosmic_text::Weight { - floem::cosmic_text::Weight::NORMAL + fn weight(&self, _: EditorId, _line: usize) -> floem::text::Weight { + floem::text::Weight::NORMAL } - fn italic_style(&self, _: EditorId, _line: usize) -> floem::cosmic_text::Style { - floem::cosmic_text::Style::Normal + fn italic_style(&self, _: EditorId, _line: usize) -> floem::text::Style { + floem::text::Style::Normal } - fn stretch(&self, _: EditorId, _line: usize) -> floem::cosmic_text::Stretch { - floem::cosmic_text::Stretch::Normal + fn stretch(&self, _: EditorId, _line: usize) -> floem::text::Stretch { + floem::text::Stretch::Normal } fn indent_line(&self, _: EditorId, line: usize, line_content: &str) -> usize { @@ -2093,8 +2093,8 @@ fn extra_styles_for_range( return None; } - let height = (run.glyph_ascent + run.glyph_descent) as f64; - let y = run.line_y as f64 - run.glyph_ascent as f64; + let height = (run.max_ascent + run.max_descent) as f64; + let y = run.line_y as f64 - run.max_ascent as f64; Some(LineExtraStyle { x, diff --git a/lapce-app/src/editor/gutter.rs b/lapce-app/src/editor/gutter.rs index 812ba20a1d..0576de2d88 100644 --- a/lapce-app/src/editor/gutter.rs +++ b/lapce-app/src/editor/gutter.rs @@ -1,7 +1,7 @@ use floem::{ context::PaintCx, - cosmic_text::{Attrs, AttrsList, FamilyOwned, TextLayout}, peniko::kurbo::{Point, Rect, Size}, + text::{Attrs, AttrsList, FamilyOwned, TextLayout}, Renderer, View, ViewId, }; use lapce_core::{buffer::rope_text::RopeText, mode::Mode}; diff --git a/lapce-app/src/file_explorer/view.rs b/lapce-app/src/file_explorer/view.rs index 2344e0cdc5..e78e391e70 100644 --- a/lapce-app/src/file_explorer/view.rs +++ b/lapce-app/src/file_explorer/view.rs @@ -1,11 +1,11 @@ use std::{path::Path, rc::Rc, sync::Arc}; use floem::{ - cosmic_text::Style as FontStyle, event::{Event, EventListener}, peniko::Color, reactive::{create_rw_signal, ReadSignal, RwSignal}, style::{AlignItems, CursorStyle, Position, Style}, + text::Style as FontStyle, views::{ container, dyn_stack, label, scroll, stack, svg, virtual_stack, Container, Decorators, VirtualDirection, VirtualItemSize, diff --git a/lapce-app/src/focus_text.rs b/lapce-app/src/focus_text.rs index 2d8faf24ff..af5033de37 100644 --- a/lapce-app/src/focus_text.rs +++ b/lapce-app/src/focus_text.rs @@ -1,5 +1,4 @@ use floem::{ - cosmic_text::{Attrs, AttrsList, FamilyOwned, TextLayout, Weight}, peniko::{ kurbo::{Point, Rect}, Color, @@ -8,6 +7,7 @@ use floem::{ reactive::create_effect, style::{FontFamily, FontSize, LineHeight, Style, TextColor}, taffy::prelude::NodeId, + text::{Attrs, AttrsList, FamilyOwned, TextLayout, Weight}, Renderer, View, ViewId, }; diff --git a/lapce-app/src/markdown.rs b/lapce-app/src/markdown.rs index 161bb6b3ac..f9e384365a 100644 --- a/lapce-app/src/markdown.rs +++ b/lapce-app/src/markdown.rs @@ -1,4 +1,4 @@ -use floem::cosmic_text::{ +use floem::text::{ Attrs, AttrsList, FamilyOwned, LineHeightValue, Style, TextLayout, Weight, }; use lapce_core::{language::LapceLanguage, syntax::Syntax}; diff --git a/lapce-app/src/panel/debug_view.rs b/lapce-app/src/panel/debug_view.rs index 89ca8c4f0c..a88bc29088 100644 --- a/lapce-app/src/panel/debug_view.rs +++ b/lapce-app/src/panel/debug_view.rs @@ -1,11 +1,11 @@ use std::{rc::Rc, sync::Arc}; use floem::{ - cosmic_text::Style as FontStyle, event::EventListener, peniko::Color, reactive::{create_rw_signal, ReadSignal, RwSignal}, style::CursorStyle, + text::Style as FontStyle, views::{ container, dyn_stack, label, scroll, stack, svg, text, virtual_stack, Decorators, VirtualDirection, VirtualItemSize, diff --git a/lapce-app/src/settings.rs b/lapce-app/src/settings.rs index a0c1b6b1d8..a9df7e3d88 100644 --- a/lapce-app/src/settings.rs +++ b/lapce-app/src/settings.rs @@ -2,7 +2,6 @@ use std::{collections::BTreeMap, rc::Rc, sync::Arc, time::Duration}; use floem::{ action::{add_overlay, exec_after, remove_overlay, TimerToken}, - cosmic_text::{Attrs, AttrsList, FamilyOwned, TextLayout}, event::EventListener, keyboard::Modifiers, peniko::kurbo::{Point, Rect, Size}, @@ -11,6 +10,7 @@ use floem::{ Scope, }, style::CursorStyle, + text::{Attrs, AttrsList, FamilyOwned, TextLayout}, views::{ container, dyn_stack, empty, label, scroll::{scroll, PropagatePointerWheel}, diff --git a/lapce-app/src/terminal/view.rs b/lapce-app/src/terminal/view.rs index 75204dae65..f0f69c618a 100644 --- a/lapce-app/src/terminal/view.rs +++ b/lapce-app/src/terminal/view.rs @@ -8,7 +8,6 @@ use alacritty_terminal::{ }; use floem::{ context::{EventCx, PaintCx}, - cosmic_text::{Attrs, AttrsList, FamilyOwned, TextLayout, Weight}, event::{Event, EventPropagation}, peniko::{ kurbo::{Point, Rect, Size}, @@ -16,6 +15,7 @@ use floem::{ }, pointer::PointerInputEvent, reactive::{create_effect, ReadSignal, RwSignal}, + text::{Attrs, AttrsList, FamilyOwned, TextLayout, Weight}, views::editor::{core::register::Clipboard, text::SystemClipboard}, Renderer, View, ViewId, }; diff --git a/lapce-app/src/text_area.rs b/lapce-app/src/text_area.rs index 696e0d3e9b..cb54e45a40 100644 --- a/lapce-app/src/text_area.rs +++ b/lapce-app/src/text_area.rs @@ -1,7 +1,7 @@ use floem::{ - cosmic_text::{Attrs, AttrsList, LineHeightValue, TextLayout}, peniko::kurbo::Rect, reactive::{create_effect, create_rw_signal}, + text::{Attrs, AttrsList, LineHeightValue, TextLayout}, views::{container, label, rich_text, scroll, stack, Decorators}, View, }; diff --git a/lapce-app/src/text_input.rs b/lapce-app/src/text_input.rs index cdc1797123..05f9f85b9e 100644 --- a/lapce-app/src/text_input.rs +++ b/lapce-app/src/text_input.rs @@ -3,7 +3,6 @@ use std::{rc::Rc, sync::Arc}; use floem::{ action::{set_ime_allowed, set_ime_cursor_area}, context::EventCx, - cosmic_text::{Attrs, AttrsList, FamilyOwned, TextLayout}, event::{Event, EventListener, EventPropagation}, peniko::{ kurbo::{Line, Point, Rect, Size, Vec2}, @@ -19,6 +18,7 @@ use floem::{ PaddingLeft, Style, TextColor, }, taffy::prelude::NodeId, + text::{Attrs, AttrsList, FamilyOwned, TextLayout}, unit::PxPct, views::Decorators, Renderer, View, ViewId, diff --git a/lapce-app/src/window_tab.rs b/lapce-app/src/window_tab.rs index 338f08ca3f..437b052e2f 100644 --- a/lapce-app/src/window_tab.rs +++ b/lapce-app/src/window_tab.rs @@ -11,13 +11,13 @@ use std::{ use crossbeam_channel::Sender; use floem::{ action::{open_file, remove_overlay, TimerToken}, - cosmic_text::{Attrs, AttrsList, FamilyOwned, LineHeightValue, TextLayout}, ext_event::{create_ext_action, create_signal_from_channel}, file::FileDialogOptions, keyboard::Modifiers, kurbo::Size, peniko::kurbo::{Point, Rect, Vec2}, reactive::{use_context, Memo, ReadSignal, RwSignal, Scope, WriteSignal}, + text::{Attrs, AttrsList, FamilyOwned, LineHeightValue, TextLayout}, ViewId, }; use indexmap::IndexMap; diff --git a/lapce-core/src/language.rs b/lapce-core/src/language.rs index 250bd859e4..53c9ae4991 100644 --- a/lapce-core/src/language.rs +++ b/lapce-core/src/language.rs @@ -867,7 +867,7 @@ const LANGUAGES: &[SyntaxProperties] = &[ }, SyntaxProperties { id: LapceLanguage::Go, - indent: Indent::space(4), + indent: Indent::tab(), files: &[], extensions: &["go"], comment: comment_properties!("//"), @@ -1677,10 +1677,6 @@ const LANGUAGES: &[SyntaxProperties] = &[ impl LapceLanguage { const HIGHLIGHTS_INJECTIONS_FILE_NAME: &'static str = "injections.scm"; const HIGHLIGHTS_QUERIES_FILE_NAME: &'static str = "highlights.scm"; - #[cfg(unix)] - const SYSTEM_GRAMMARS_DIRECTORY: &'static str = "/usr/lib"; - #[cfg(unix)] - const SYSTEM_QUERIES_DIRECTORY: &'static str = "/usr/share/tree-sitter/grammars"; pub fn from_path(path: &Path) -> LapceLanguage { Self::from_path_raw(path).unwrap_or(LapceLanguage::PlainText)