Skip to content
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

Discrepency in single-column format with --display=inline vs default (side-by-side) #670

Open
edwardpeek-crown opened this issue Mar 22, 2024 · 1 comment

Comments

@edwardpeek-crown
Copy link

Forcing single-column formatting using --display=inline has subtle formatting differences for certain changes that would show as single-column anyway with default options.

eg.

$ echo 'int("10", 10)' > a.py
$ echo 'int("10", base=10)' > b.py
$ difft a.py b.py 
b.py --- Python
1 int("10", base=10)

$ difft --display=inline a.py b.py 
b.py --- Python
1    int("10", 10)
   1 int("10", base=10)

With colour:
image
image

The automatic single-column format is a lot more readable in this example. Other examples also cause the forced single-line format to silently drop context lines and widen the readability gap to the default format.

Observed with cargo install version Difftastic 0.56.1 (built with rustc 1.75.0)

@edwardpeek-crown
Copy link
Author

Another example, context lines in the middle of the diff are not shown:

$ echo 'print("a", "b", "c")' > a.py
$ echo -e 'print(\n    "a",\n    "b",\n    "c",\n    "d",\n)' > b.py
$ difft a.py b.py
b.py --- Python
1 1 print(
. 2     "a",
. 3     "b",
. 4     "c",
. 5     "d",
. 6 )

$ difft --display=inline a.py b.py 
b.py --- Python
1    print("a", "b", "c")
   4     "c",
   5     "d",
   6 )

image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant