summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Davison <dandavison7@gmail.com>2021-12-04 16:53:13 -0500
committerDan Davison <dandavison7@gmail.com>2021-12-05 11:25:05 -0500
commit6f5090b7638aa8c9f88828a2e2631f6f5df84c8a (patch)
treefebc0ede222f7a9011c5c80731c2e1bcf9f52461
parent1f41d4f7cdde5480658ac2b1f051e135536922e6 (diff)
Do not truncate hunk header line
Fixes #813
-rw-r--r--src/delta.rs6
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(