-
Notifications
You must be signed in to change notification settings - Fork 378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 Panic in src/wrapping.rs:469
for a correct patch with syntax highlight and line wrapping
#1724
Comments
src/wrapping.rs:469
for a correct patch with syntax highlight and line wrapping
Thank you for your bug reports! Unfortunately, I was unable to reproduce this by resizing my terminal to various sizes, using the current main or v0.17 of delta. Can you try with |
I get the same panic:
It fails with Unfortunately I cannot share the diff (confidential source), but I managed to narrow down which config options, when disabled, prevent the panic:
When I remove Full backtrace:
|
Sorry for a slow response. Here:
I noticed that if I set I'll try to reproduce with the |
Mixed up with another bug. And the |
Here is my first attempt at creating a unit test that would reproduce this issue: WIP: A line wrapping test that is panicking I do not understand how to enable syntax highlight in the test. I was wondering if maybe it has something to do with a Unicode character used for the line continuation, but that seems to work OK. |
Yes, those are probably two different triggers, And I can't trigger it with the % git checkout 0.17.0 && cargo build --release >& /dev/null && cat -A bad.patch && sha1sum bad.patch && \
HOME=/ target/release/delta --no-gitconfig --side-by-side < bad.patch && echo SUCCESS at $COLUMNS
HEAD is now at 13c8219 Bump version
diff --git a.rs b.rs$
--- a.rs$
+++ b.rs$
@@ -127,6 +128,16 @@ f() {$
a$
+ "------------------------------------------------------------------------------------------\$
z$
}$
61dd3d44d6605e7ba5d552ca4b2bb426c5d10b88 bad.patch
[..]
SUCCESS at 212 |
I am also getting this issue.
Command: env - TERM=xterm COLORTERM=truecolor "$(which delta)" --no-gitconfig --side-by-side --width=60 < /tmp/diff.diff The diff will also fail with Contents of commit 6f45d481f266936ebe48db0445c8872e51f38af6
Author:
Date:
feat: feat
diff --git a/a.cc b/a.cc
index 57eca873..5b0da8b1 100644
--- a/a.cc
+++ b/a.cc
@@ -2,18 +3,18 @@ a
+ void aaaaadbbdcccc()
@@ -240,3 +240,3 @@ protected:
- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa; // TODO: check that this can come before a path change
+ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;
Error: thread 'main' panicked at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/git-delta-0.18.1/src/wrapping.rs:469:9:
assertion `left == right` failed: syntax and diff wrapping differs (-) [*r*]
left: (0, 1)
right: (0, 2)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace Depending on window size, the error in #1726 can happen instead. Some further things I've noted:
|
If you obtained the binary via |
Yes, this worked. Thanks! |
Should be fixed in 0.18.2 and work without |
With the following patch:
I see an assertion failure if my terminal is narrow enough, such that
delta
needs to wrap the diff line.Note that if I remove the
"
at the beginning or the\
at the end, then no panic happens, and the patch is presented correctly. Even if the line wrap needs to happen.The output that I see is as follows:
The text was updated successfully, but these errors were encountered: