Skip to content

Commit

Permalink
Use 4 spaces for error formatting indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
filiptibell committed Oct 17, 2024
1 parent d090cd2 commit f89d02a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion crates/lune-utils/src/fmt/error/components.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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`].
Expand Down Expand Up @@ -86,7 +91,7 @@ impl fmt::Display for ErrorComponents {
let trace = self.trace.as_ref().unwrap();
writeln!(f, "{}", *STYLED_STACK_BEGIN)?;
for line in trace.lines() {
writeln!(f, "\t{line}")?;
writeln!(f, "{STACK_TRACE_INDENT}{line}")?;
}
writeln!(f, "{}", *STYLED_STACK_END)?;
}
Expand Down

0 comments on commit f89d02a

Please sign in to comment.