mirror of https://github.com/zkat/miette.git
feat(graphical): compact graphical display a bit
This commit is contained in:
parent
8e11baab7b
commit
db637a366b
|
|
@ -204,7 +204,6 @@ impl GraphicalReportHandler {
|
||||||
|
|
||||||
fn render_footer(&self, f: &mut impl fmt::Write, diagnostic: &(dyn Diagnostic)) -> fmt::Result {
|
fn render_footer(&self, f: &mut impl fmt::Write, diagnostic: &(dyn Diagnostic)) -> fmt::Result {
|
||||||
if let Some(help) = diagnostic.help() {
|
if let Some(help) = diagnostic.help() {
|
||||||
writeln!(f)?;
|
|
||||||
let width = self.termwidth.saturating_sub(4);
|
let width = self.termwidth.saturating_sub(4);
|
||||||
let initial_indent = " help: ".style(self.theme.styles.help).to_string();
|
let initial_indent = " help: ".style(self.theme.styles.help).to_string();
|
||||||
let opts = textwrap::Options::new(width)
|
let opts = textwrap::Options::new(width)
|
||||||
|
|
@ -245,7 +244,6 @@ impl GraphicalReportHandler {
|
||||||
let mut labels = labels.collect::<Vec<_>>();
|
let mut labels = labels.collect::<Vec<_>>();
|
||||||
labels.sort_unstable_by_key(|l| l.inner().offset());
|
labels.sort_unstable_by_key(|l| l.inner().offset());
|
||||||
if !labels.is_empty() {
|
if !labels.is_empty() {
|
||||||
writeln!(f)?;
|
|
||||||
let contents = labels
|
let contents = labels
|
||||||
.iter()
|
.iter()
|
||||||
.map(|label| {
|
.map(|label| {
|
||||||
|
|
@ -363,14 +361,6 @@ impl GraphicalReportHandler {
|
||||||
writeln!(f, "[{}:{}]", contents.line() + 1, contents.column() + 1)?;
|
writeln!(f, "[{}:{}]", contents.line() + 1, contents.column() + 1)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Blank line to improve readability
|
|
||||||
writeln!(
|
|
||||||
f,
|
|
||||||
"{}{}",
|
|
||||||
" ".repeat(linum_width + 2),
|
|
||||||
self.theme.characters.vbar,
|
|
||||||
)?;
|
|
||||||
|
|
||||||
// Now it's time for the fun part--actually rendering everything!
|
// Now it's time for the fun part--actually rendering everything!
|
||||||
for line in &lines {
|
for line in &lines {
|
||||||
// Line number, appropriately padded.
|
// Line number, appropriately padded.
|
||||||
|
|
@ -413,12 +403,6 @@ impl GraphicalReportHandler {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
writeln!(
|
|
||||||
f,
|
|
||||||
"{}{}",
|
|
||||||
" ".repeat(linum_width + 2),
|
|
||||||
self.theme.characters.vbar,
|
|
||||||
)?;
|
|
||||||
writeln!(
|
writeln!(
|
||||||
f,
|
f,
|
||||||
"{}{}{}",
|
"{}{}{}",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue