Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix too many anonymized line numbers #5

merged 1 commit into from Jul 15, 2019
Changes from all commits
File filter
Filter by extension
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -303,7 +303,7 @@ impl DisplayListFormatter {
} => {
let lineno = if self.anonymized_line_numbers {
let lineno = if self.anonymized_line_numbers && lineno.is_some() {
} else {
self.format_lineno(*lineno, lineno_width)
@@ -515,13 +515,26 @@ fn test_anon_lines() {
range: (0, 19),
DisplayLine::Source {
lineno: None,
inline_marks: vec![],
line: DisplaySourceLine::Empty,

This comment has been minimized.


phansch Jul 15, 2019
Author Member

Should the case of DisplaySourceLine::Empty + Some(lineno) also be handled in some way? I didn't see any test cases for it, so I left that out for now.

DisplayLine::Source {
lineno: None,
inline_marks: vec![],
line: DisplaySourceLine::Content {
text: "abc".to_string(),
range: (0, 19),

let dlf = DisplayListFormatter::new(false, true);

"LL | This is an example\nLL | of content lines"
"LL | This is an example\nLL | of content lines\n |\n | abc"