From 16212eaf52657ea47bba7add7deac378d0bf4b4a Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sun, 28 Jul 2024 23:59:51 +0200 Subject: Simplify `highlight` method for `text_editor` widget --- examples/markdown/src/main.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'examples/markdown') 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::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); -- cgit