Skip to content

Commit

Permalink
feat: Update freya and use the new experimental paragraph cache
Browse files Browse the repository at this point in the history
  • Loading branch information
marc2332 committed Nov 18, 2024
1 parent cedfa22 commit cadfbba
Show file tree
Hide file tree
Showing 8 changed files with 158 additions and 335 deletions.
459 changes: 141 additions & 318 deletions Cargo.lock

Large diffs are not rendered by default.

16 changes: 7 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
[package]
name = "valin"
version = "0.0.15"
version = "0.0.16"
edition = "2021"

[patch.crates-io]
dioxus-sdk = { git = "https://github.com/DioxusLabs/sdk", rev = "57ab3fa972c6d4a7acc25e82a0aafc3ff9e63403" }

[dependencies]
freya-node-state = { git = "https://github.com/marc2332/freya", rev = "175aa299029e797b7288f51b4d95c2d53a45fce9" }
freya = { git = "https://github.com/marc2332/freya", rev = "175aa299029e797b7288f51b4d95c2d53a45fce9" }
freya-hooks = { git = "https://github.com/marc2332/freya", rev = "175aa299029e797b7288f51b4d95c2d53a45fce9" }
freya-node-state = { git = "https://github.com/marc2332/freya", rev = "e617db5a733297fc4e52f75936b53a690d807c82" }
freya = { git = "https://github.com/marc2332/freya", rev = "e617db5a733297fc4e52f75936b53a690d807c82" }
freya-hooks = { git = "https://github.com/marc2332/freya", rev = "e617db5a733297fc4e52f75936b53a690d807c82" }

dioxus-radio = "0.2.4"
dioxus = "0.5"
dioxus-sdk = { git = "https://github.com/DioxusLabs/sdk", rev = "57ab3fa972c6d4a7acc25e82a0aafc3ff9e63403", features = ["clipboard", "timing"] }
dioxus-clipboard = "*"
dioxus-sdk = { git = "https://github.com/DioxusLabs/sdk", rev = "57ab3fa972c6d4a7acc25e82a0aafc3ff9e63403", features = ["timing"] }

tokio = { version = "1.33.0", features = ["fs", "process"]}
winit = "0.30.1"
skia-safe = { version = "0.75.0", features = ["gl", "textlayout", "svg"] }
skia-safe = { version = "0.80.0", features = ["gl", "textlayout", "svg"] }

ropey = "1.6.0"
smallvec = "1.10.0"
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "1.79.0"
channel = "1.82.0"
profile = "default"
2 changes: 1 addition & 1 deletion src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ use crate::{
use crate::{global_defaults::GlobalDefaults, state::KeyboardShortcuts};
use crate::{hooks::*, settings::watch_settings};
use crate::{tabs::editor::EditorTab, utils::*};
use dioxus_clipboard::prelude::use_clipboard;
use dioxus_radio::prelude::*;
use dioxus_sdk::clipboard::use_clipboard;
use freya::prelude::*;
use std::sync::Arc;
use tracing::info;
Expand Down
4 changes: 2 additions & 2 deletions src/components/editor_panel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ pub fn EditorPanel(EditorPanelProps { panel_index, width }: EditorPanelProps) ->
Button {
theme: theme_with!(ButtonTheme {
height: "fill".into(),
padding: "10 8".into(),
padding: "0 8".into(),
}),
onpress: close_panel,
label {
Expand All @@ -101,7 +101,7 @@ pub fn EditorPanel(EditorPanelProps { panel_index, width }: EditorPanelProps) ->
Button {
theme: theme_with!(ButtonTheme {
height: "fill".into(),
padding: "10 8".into(),
padding: "0 8".into(),
}),
onpress: split_panel,
label {
Expand Down
3 changes: 2 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ fn main() {
config
.with_size(1280.0, 720.0)
.with_title("Valin")
.with_state(Arc::new(args)),
.with_state(Arc::new(args))
.with_max_paragraph_cache_size(200),
);
}
2 changes: 1 addition & 1 deletion src/state/app.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::{collections::HashMap, vec};

use dioxus_clipboard::prelude::UseClipboard;
use dioxus_radio::prelude::{Radio, RadioChannel};
use dioxus_sdk::clipboard::UseClipboard;
use skia_safe::{textlayout::FontCollection, FontMgr};
use tracing::info;

Expand Down
5 changes: 3 additions & 2 deletions src/tabs/editor/editor_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::cell::RefCell;
use std::rc::Rc;
use std::{cmp::Ordering, fmt::Display, ops::Range, path::PathBuf};

use dioxus_sdk::clipboard::UseClipboard;
use dioxus_clipboard::prelude::UseClipboard;
use freya::hooks::{EditorHistory, HistoryChange, Line, TextCursor, TextEditor};
use freya::prelude::Rope;
use freya_hooks::LinesIterator;
Expand Down Expand Up @@ -145,7 +145,8 @@ impl Display for EditorData {
}

impl TextEditor for EditorData {
type LinesIterator<'a> = LinesIterator<'a>
type LinesIterator<'a>
= LinesIterator<'a>
where
Self: 'a;

Expand Down

0 comments on commit cadfbba

Please sign in to comment.