fix: index out of bounds when blaming a file ending with a blank line (#2130)

This commit is contained in:
Trung Tran 2024-03-17 11:43:08 +07:00 committed by extrawurst
parent baddec0e39
commit 99b9a38fb3

View File

@ -572,7 +572,8 @@ impl BlameFilePopup {
.iter() .iter()
.map(|l| l.1.clone()) .map(|l| l.1.clone())
.collect::<Vec<_>>(); .collect::<Vec<_>>();
let text = tabs_to_spaces(raw_lines.join("\n")); let mut text = tabs_to_spaces(raw_lines.join("\n"));
text.push('\n');
job.spawn(AsyncSyntaxJob::new( job.spawn(AsyncSyntaxJob::new(
text, text,