Replace println with log calls in markdown module
This commit is contained in:
parent
4b8fc23840
commit
bc2d662af7
3 changed files with 9 additions and 3 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
|
@ -2640,6 +2640,7 @@ dependencies = [
|
|||
"iced_highlighter",
|
||||
"iced_renderer",
|
||||
"iced_runtime",
|
||||
"log",
|
||||
"num-traits",
|
||||
"ouroboros",
|
||||
"pulldown-cmark",
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue