Skip to content

Commit 04dd84c

Browse files
committed
fix missing/duped line case
1 parent eaddfee commit 04dd84c

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/extract.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,10 @@ pub fn extract<'i, I: IndexData + 'i>(
178178
let last_idx = blocks.len() - 1;
179179
active_block = blocks.remove(last_idx);
180180
}
181-
start_printing = prev_section_end;
181+
// prev_section_end' line already contained in some block, so start
182+
// from next one. (Except from case from State::Printing and empty active_block,
183+
// idk?).
184+
start_printing = prev_section_end + 1;
182185
} else {
183186
start_printing = section_start.saturating_sub(config.context_lines);
184187
}
@@ -206,6 +209,7 @@ pub fn extract<'i, I: IndexData + 'i>(
206209
State::Printing => {
207210
if lines[i].score <= config.block_separator_max_score {
208211
if !active_block.is_empty() {
212+
active_block.push(lines[i].line);
209213
blocks.push(mem::replace(&mut active_block, vec![]));
210214
}
211215
prev_section_end = i;

tests/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Runner group name: 'Default Larger Runners'
3030
Machine name: 'runner'
3131
##[group]Operating System
3232
Ubuntu
33-
LTS
33+
20.04.6
3434
LTS
3535
##[endgroup]
3636
##[group]Runner Image

0 commit comments

Comments
 (0)