Skip to content

Commit

Permalink
Do not truncate hunk header line
Browse files Browse the repository at this point in the history
Fixes #813
  • Loading branch information
dandavison committed Dec 5, 2021
1 parent 1f41d4f commit 6f5090b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/delta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,9 @@ impl<'a> StateMachine<'a> {
}
if self.config.max_line_length > 0
&& self.raw_line.len() > self.config.max_line_length
// We must not truncate ripgrep --json output
// TODO: An alternative might be to truncate `line` but retain
// `raw_line` untruncated?
// Do not truncate long hunk headers
&& !self.raw_line.starts_with("@@")
// Do not truncate ripgrep --json output
&& !self.raw_line.starts_with('{')
{
self.raw_line = ansi::truncate_str(
Expand Down

0 comments on commit 6f5090b

Please sign in to comment.