Skip to content

Commit

Permalink
+1
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 committed Nov 28, 2022
1 parent b8ffedc commit 6da9341
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/swc_error_reporters/src/lib.rs
Expand Up @@ -82,7 +82,7 @@ impl SourceCode for MietteSourceCode<'_> {
.with_span_to_prev_source(span, |src| {
let len = src
.rsplit('\n')
.take(context_lines_before)
.take(context_lines_before + 1)
.map(|s| s.len() + 1)
.sum::<usize>();

Expand All @@ -96,7 +96,7 @@ impl SourceCode for MietteSourceCode<'_> {
.with_span_to_next_source(span, |src| {
let len = src
.split('\n')
.take(context_lines_after)
.take(context_lines_after + 1)
.map(|s| s.len() + 1)
.sum::<usize>();

Expand Down

0 comments on commit 6da9341

Please sign in to comment.