diff --git a/Cargo.lock b/Cargo.lock index 0ad8c0b354..409494238f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2640,6 +2640,7 @@ dependencies = [ "iced_highlighter", "iced_renderer", "iced_runtime", + "log", "num-traits", "ouroboros", "pulldown-cmark", diff --git a/widget/Cargo.toml b/widget/Cargo.toml index e19cad0843..6d1f054e56 100644 --- a/widget/Cargo.toml +++ b/widget/Cargo.toml @@ -33,6 +33,7 @@ iced_renderer.workspace = true iced_runtime.workspace = true num-traits.workspace = true +log.workspace = true rustc-hash.workspace = true thiserror.workspace = true unicode-segmentation.workspace = true diff --git a/widget/src/markdown.rs b/widget/src/markdown.rs index 7f6965e59c..77a560ecb1 100644 --- a/widget/src/markdown.rs +++ b/widget/src/markdown.rs @@ -313,18 +313,22 @@ impl Highlighter { Some(line) if line.0 == text => {} _ => { if self.current + 1 < self.lines.len() { - println!("Resetting..."); + log::debug!("Resetting highlighter..."); self.parser.reset(); self.lines.truncate(self.current); for line in &self.lines { - println!("Refeeding {n} lines", n = self.lines.len()); + log::debug!( + "Refeeding {n} lines", + n = self.lines.len() + ); let _ = self.parser.highlight_line(&line.0); } } - println!("Parsing: {text}", text = text.trim_end()); + log::trace!("Parsing: {text}", text = text.trim_end()); + if self.current + 1 < self.lines.len() { self.parser.commit(); }