Skip to content

chore: Fix typos #182

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

Merged
merged 1 commit into from
Mar 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions src/renderer/display_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1230,25 +1230,25 @@ fn fold_body(body: Vec<DisplayLine<'_>>) -> Vec<DisplayLine<'_>> {
const INNER_UNFOLD_SIZE: usize = INNER_CONTEXT * 2 + 1;

let mut lines = vec![];
let mut unhighlighed_lines = vec![];
let mut unhighlighted_lines = vec![];
for line in body {
match &line {
DisplayLine::Source { annotations, .. } => {
if annotations.is_empty() {
unhighlighed_lines.push(line);
unhighlighted_lines.push(line);
} else {
if lines.is_empty() {
// Ignore leading unhighlighed lines
unhighlighed_lines.clear();
// Ignore leading unhighlighted lines
unhighlighted_lines.clear();
}
match unhighlighed_lines.len() {
match unhighlighted_lines.len() {
0 => {}
n if n <= INNER_UNFOLD_SIZE => {
// Rather than render `...`, don't fold
lines.append(&mut unhighlighed_lines);
lines.append(&mut unhighlighted_lines);
}
_ => {
lines.extend(unhighlighed_lines.drain(..INNER_CONTEXT));
lines.extend(unhighlighted_lines.drain(..INNER_CONTEXT));
let inline_marks = lines
.last()
.and_then(|line| {
Expand All @@ -1266,16 +1266,16 @@ fn fold_body(body: Vec<DisplayLine<'_>>) -> Vec<DisplayLine<'_>> {
lines.push(DisplayLine::Fold {
inline_marks: inline_marks.clone(),
});
unhighlighed_lines
.drain(..unhighlighed_lines.len().saturating_sub(INNER_CONTEXT));
lines.append(&mut unhighlighed_lines);
unhighlighted_lines
.drain(..unhighlighted_lines.len().saturating_sub(INNER_CONTEXT));
lines.append(&mut unhighlighted_lines);
}
}
lines.push(line);
}
}
_ => {
unhighlighed_lines.push(line);
unhighlighted_lines.push(line);
}
}
}
Expand Down