diff options
author | Dan Davison <dandavison7@gmail.com> | 2021-12-04 16:53:13 -0500 |
---|---|---|
committer | Dan Davison <dandavison7@gmail.com> | 2021-12-05 11:25:05 -0500 |
commit | 6f5090b7638aa8c9f88828a2e2631f6f5df84c8a (patch) | |
tree | febc0ede222f7a9011c5c80731c2e1bcf9f52461 /src | |
parent | 1f41d4f7cdde5480658ac2b1f051e135536922e6 (diff) |
Do not truncate hunk header line
Fixes #813
Diffstat (limited to 'src')
-rw-r--r-- | src/delta.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/delta.rs b/src/delta.rs index 23f85eec..9a65aaa5 100644 --- a/src/delta.rs +++ b/src/delta.rs @@ -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( |