diff options
author | Trung Tran <trandinhtrung176@gmail.com> | 2024-03-17 11:43:08 +0700 |
---|---|---|
committer | extrawurst <776816+extrawurst@users.noreply.github.com> | 2024-03-20 01:37:59 +0100 |
commit | 99b9a38fb3859c6f97a5ce89c0eb096ced5f6e87 (patch) | |
tree | e9e9e38602fe231d7bdd854ce22c9b8853582d5d /src | |
parent | baddec0e3958e44ecef817607f67f603b4813bb4 (diff) |
fix: index out of bounds when blaming a file ending with a blank line (#2130)
Diffstat (limited to 'src')
-rw-r--r-- | src/popups/blame_file.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/popups/blame_file.rs b/src/popups/blame_file.rs index 65c7c202..af2fdb90 100644 --- a/src/popups/blame_file.rs +++ b/src/popups/blame_file.rs @@ -572,7 +572,8 @@ impl BlameFilePopup { .iter() .map(|l| l.1.clone()) .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( text, |