aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPolesznyák Márk <contact@pml68.dev>2025-09-30 10:23:55 +0200
committerPolesznyák Márk <contact@pml68.dev>2025-09-30 10:51:02 +0200
commita0cd6e9c9f73edd2c1e89e28a8d6d3dbefbcfbf4 (patch)
tree4036fa89af5dbcda6c2bec190815a674d1eadd8a
parentfeat: add build manifest (diff)
downloadiced_custom_highlighter-a0cd6e9c9f73edd2c1e89e28a8d6d3dbefbcfbf4.tar.gz
docs(README): add builds.sr.ht status badge
-rw-r--r--Cargo.toml4
-rw-r--r--README.md2
-rw-r--r--src/lib.rs6
3 files changed, 9 insertions, 3 deletions
diff --git a/Cargo.toml b/Cargo.toml
index a7bbeab..eec44a8 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -22,6 +22,10 @@ two-face = { version = "0.4", default-features = false, features = [
git = "https://github.com/pml68/iced"
branch = "feat/rehighlight-on-redraw"
+[dev-dependencies.iced]
+git = "https://github.com/pml68/iced"
+branch = "feat/rehighlight-on-redraw"
+
[package.metadata.docs.rs]
rustdoc-args = ["--cfg", "docsrs"]
all-features = true
diff --git a/README.md b/README.md
index 577e601..2ca543c 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,7 @@
# iced_custom_highlighter
+[![builds.sr.ht status](https://builds.sr.ht/~pml68/iced_custom_highlighter.svg)](https://builds.sr.ht/~pml68/iced_custom_highlighter)
+
A custom syntax highlighter for iced.
It uses the colors from your app's Theme, based on a styling method (like `default_style`)
diff --git a/src/lib.rs b/src/lib.rs
index 94ff5e9..441df27 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -12,7 +12,7 @@
//! #[derive(Default)]
//! struct State {
//! content: text_editor::Content,
-//! theme: Theme,
+//! theme: Option<Theme>,
//! }
//!
//! #[derive(Debug, Clone)]
@@ -34,7 +34,7 @@
//! )
//! .push(pick_list(
//! Theme::ALL,
-//! Some(state.theme),
+//! state.theme.clone(),
//! Message::ChangeTheme,
//! ))
//! .into()
@@ -47,7 +47,7 @@
//! }
//!
//! Message::ChangeTheme(theme) => {
-//! state.theme = theme;
+//! state.theme = Some(theme);
//! }
//! }
//! }