mirror of
https://github.com/lune-org/lune.git
synced 2025-01-06 03:19:10 +00:00
Use 4 spaces for error formatting indentation
This commit is contained in:
parent
d090cd2420
commit
f89d02a60d
1 changed files with 6 additions and 1 deletions
|
@ -26,6 +26,11 @@ static STYLED_STACK_END: Lazy<String> = Lazy::new(|| {
|
||||||
)
|
)
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// NOTE: We indent using 4 spaces instead of tabs since
|
||||||
|
// these errors are most likely to be displayed in a terminal
|
||||||
|
// or some kind of live output - and tabs don't work well there
|
||||||
|
const STACK_TRACE_INDENT: &str = " ";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Error components parsed from a [`LuaError`].
|
Error components parsed from a [`LuaError`].
|
||||||
|
|
||||||
|
@ -86,7 +91,7 @@ impl fmt::Display for ErrorComponents {
|
||||||
let trace = self.trace.as_ref().unwrap();
|
let trace = self.trace.as_ref().unwrap();
|
||||||
writeln!(f, "{}", *STYLED_STACK_BEGIN)?;
|
writeln!(f, "{}", *STYLED_STACK_BEGIN)?;
|
||||||
for line in trace.lines() {
|
for line in trace.lines() {
|
||||||
writeln!(f, "\t{line}")?;
|
writeln!(f, "{STACK_TRACE_INDENT}{line}")?;
|
||||||
}
|
}
|
||||||
writeln!(f, "{}", *STYLED_STACK_END)?;
|
writeln!(f, "{}", *STYLED_STACK_END)?;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue