summaryrefslogtreecommitdiffstats
path: root/examples/markdown
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-07-28 23:59:51 +0200
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-07-28 23:59:51 +0200
commit16212eaf52657ea47bba7add7deac378d0bf4b4a (patch)
tree27feb673ab07016a48ee1ae491fa7331a349cabb /examples/markdown
parent1aa0a8fa0d8e5dfe9ab09a11ea7c69f71e19795b (diff)
downloadiced-16212eaf52657ea47bba7add7deac378d0bf4b4a.tar.gz
iced-16212eaf52657ea47bba7add7deac378d0bf4b4a.tar.bz2
iced-16212eaf52657ea47bba7add7deac378d0bf4b4a.zip
Simplify `highlight` method for `text_editor` widget
Diffstat (limited to 'examples/markdown')
-rw-r--r--examples/markdown/src/main.rs10
1 files changed, 2 insertions, 8 deletions
diff --git a/examples/markdown/src/main.rs b/examples/markdown/src/main.rs
index ade6e453..eb51f985 100644
--- a/examples/markdown/src/main.rs
+++ b/examples/markdown/src/main.rs
@@ -1,4 +1,4 @@
-use iced::highlighter::{self, Highlighter};
+use iced::highlighter;
use iced::widget::{self, markdown, row, scrollable, text_editor};
use iced::{Element, Fill, Font, Task, Theme};
@@ -65,13 +65,7 @@ impl Markdown {
.height(Fill)
.padding(10)
.font(Font::MONOSPACE)
- .highlight::<Highlighter>(
- highlighter::Settings {
- theme: highlighter::Theme::Base16Ocean,
- token: "markdown".to_owned(),
- },
- |highlight, _theme| highlight.to_format(),
- );
+ .highlight("markdown", highlighter::Theme::Base16Ocean);
let preview = markdown(&self.items, markdown::Settings::default())
.map(Message::LinkClicked);