Skip to content

Commit cadfbba

Browse files
committed
feat: Update freya and use the new experimental paragraph cache
1 parent cedfa22 commit cadfbba

File tree

8 files changed

+158
-335
lines changed

8 files changed

+158
-335
lines changed

Cargo.lock

Lines changed: 141 additions & 318 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,21 @@
11
[package]
22
name = "valin"
3-
version = "0.0.15"
3+
version = "0.0.16"
44
edition = "2021"
55

6-
[patch.crates-io]
7-
dioxus-sdk = { git = "https://github.com/DioxusLabs/sdk", rev = "57ab3fa972c6d4a7acc25e82a0aafc3ff9e63403" }
8-
96
[dependencies]
10-
freya-node-state = { git = "https://github.com/marc2332/freya", rev = "175aa299029e797b7288f51b4d95c2d53a45fce9" }
11-
freya = { git = "https://github.com/marc2332/freya", rev = "175aa299029e797b7288f51b4d95c2d53a45fce9" }
12-
freya-hooks = { git = "https://github.com/marc2332/freya", rev = "175aa299029e797b7288f51b4d95c2d53a45fce9" }
7+
freya-node-state = { git = "https://github.com/marc2332/freya", rev = "e617db5a733297fc4e52f75936b53a690d807c82" }
8+
freya = { git = "https://github.com/marc2332/freya", rev = "e617db5a733297fc4e52f75936b53a690d807c82" }
9+
freya-hooks = { git = "https://github.com/marc2332/freya", rev = "e617db5a733297fc4e52f75936b53a690d807c82" }
1310

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

1816
tokio = { version = "1.33.0", features = ["fs", "process"]}
1917
winit = "0.30.1"
20-
skia-safe = { version = "0.75.0", features = ["gl", "textlayout", "svg"] }
18+
skia-safe = { version = "0.80.0", features = ["gl", "textlayout", "svg"] }
2119

2220
ropey = "1.6.0"
2321
smallvec = "1.10.0"

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
2-
channel = "1.79.0"
2+
channel = "1.82.0"
33
profile = "default"

src/app.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ use crate::{
88
use crate::{global_defaults::GlobalDefaults, state::KeyboardShortcuts};
99
use crate::{hooks::*, settings::watch_settings};
1010
use crate::{tabs::editor::EditorTab, utils::*};
11+
use dioxus_clipboard::prelude::use_clipboard;
1112
use dioxus_radio::prelude::*;
12-
use dioxus_sdk::clipboard::use_clipboard;
1313
use freya::prelude::*;
1414
use std::sync::Arc;
1515
use tracing::info;

src/components/editor_panel.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ pub fn EditorPanel(EditorPanelProps { panel_index, width }: EditorPanelProps) ->
9090
Button {
9191
theme: theme_with!(ButtonTheme {
9292
height: "fill".into(),
93-
padding: "10 8".into(),
93+
padding: "0 8".into(),
9494
}),
9595
onpress: close_panel,
9696
label {
@@ -101,7 +101,7 @@ pub fn EditorPanel(EditorPanelProps { panel_index, width }: EditorPanelProps) ->
101101
Button {
102102
theme: theme_with!(ButtonTheme {
103103
height: "fill".into(),
104-
padding: "10 8".into(),
104+
padding: "0 8".into(),
105105
}),
106106
onpress: split_panel,
107107
label {

src/main.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ fn main() {
8585
config
8686
.with_size(1280.0, 720.0)
8787
.with_title("Valin")
88-
.with_state(Arc::new(args)),
88+
.with_state(Arc::new(args))
89+
.with_max_paragraph_cache_size(200),
8990
);
9091
}

src/state/app.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::{collections::HashMap, vec};
22

3+
use dioxus_clipboard::prelude::UseClipboard;
34
use dioxus_radio::prelude::{Radio, RadioChannel};
4-
use dioxus_sdk::clipboard::UseClipboard;
55
use skia_safe::{textlayout::FontCollection, FontMgr};
66
use tracing::info;
77

src/tabs/editor/editor_data.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::cell::RefCell;
33
use std::rc::Rc;
44
use std::{cmp::Ordering, fmt::Display, ops::Range, path::PathBuf};
55

6-
use dioxus_sdk::clipboard::UseClipboard;
6+
use dioxus_clipboard::prelude::UseClipboard;
77
use freya::hooks::{EditorHistory, HistoryChange, Line, TextCursor, TextEditor};
88
use freya::prelude::Rope;
99
use freya_hooks::LinesIterator;
@@ -145,7 +145,8 @@ impl Display for EditorData {
145145
}
146146

147147
impl TextEditor for EditorData {
148-
type LinesIterator<'a> = LinesIterator<'a>
148+
type LinesIterator<'a>
149+
= LinesIterator<'a>
149150
where
150151
Self: 'a;
151152

0 commit comments

Comments
 (0)