Fixed error printing

pull/2/head
Mark 2023-08-04 22:47:27 -07:00
parent 28627e7042
commit c17a9f313b
Signed by: Mark
GPG Key ID: AD62BB059C2AAEE4
1 changed files with 11 additions and 5 deletions

View File

@ -46,17 +46,23 @@ pub fn do_string(
} }
let (l, e) = r; let (l, e) = r;
let t = FormattedText::new( let mut t = FormattedText::new("".to_string());
format!( if l.zero() {
t.push(&format!(
"\n {}\n\n",
e.text().to_string(),
));
} else {
t.push(&format!(
concat!( concat!(
"{}[e]{}[n]\n", "{}[e]{}[n]\n",
" {}\n" " {}\n\n"
), ),
" ".repeat(l.pos + 4), " ".repeat(l.pos + 4),
"^".repeat(l.len), "^".repeat(l.len),
e.text().to_string(), e.text().to_string(),
) ));
); }
return Err(t); return Err(t);
} }