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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 Cannot show long lines #519

Closed
bachue opened this issue Feb 8, 2021 · 7 comments
Closed

馃悰 Cannot show long lines #519

bachue opened this issue Feb 8, 2021 · 7 comments

Comments

@bachue
Copy link

bachue commented Feb 8, 2021

Delta version 0.6.0, installed by cargo today
Mac OS X 10.13.6

git diff

Screen Shot 2021-02-08 at 16 10 16

For the long lines in diff view, I can see these are right arrows on the right side.
Then when I press the right arrow, I see this:

Screen Shot 2021-02-08 at 16 11 43

I still cannot see the full long line. I think it should be a bug.

@bachue bachue changed the title Cannot show long lines馃悰 馃悰 Cannot show long lines Feb 8, 2021
@dandavison
Copy link
Owner

Hi @bachue, this is expected behavior for side-by-side mode, so not a bug. HOWEVER, it would definitely be nice for delta to make it possible to see the full line, and there is a very exciting PR here that is adding line-wrapping to side-by-side mode: #515.

(I think the solution has to be line-wrapping. Simply pressing right arrow might work for the right panel, but it would not work for the left panel.)

@kaldown
Copy link

kaldown commented Feb 22, 2021

Just a quick question, is it possible for delta rely on less config somehow?
For instance if I have less -FRKX, and something like

[delta]
pager = less

The lines would be shown as expected withing this issue (folded).

Or this is a completely different architecture and most of the features should be written standalone no matter to a different pagers like less one?

Thanks though.
Working without syntax for years, although using delta make my day more bright :D

@Kr1ss-XD
Copy link
Contributor

Kr1ss-XD commented Feb 22, 2021

@kaldown
In general, the LESS* environment variables do take effect, altough delta processes the input and then sends it to less (and applies some default less flags, in addition to $LESS). That's why for example the line wrapping/chopping might be done before less even gets the data, esp. in side-by-side mode.

I hope that makes sense 馃檮 ?

For example with git diff, the data pipe is basically git-diff 鉃★笍 delta 鉃★笍 less; you can test the pure delta output with e.g.

git -c delta.paging=never <subcommand>

@kaldown
Copy link

kaldown commented Feb 22, 2021

Ye, makes sense, thank you for clarification.
Perhaps due to delta features like line-number, it would be hard to process output out of less.
Or why isn't there git-diff | less | delta pipeline?

@Kr1ss-XD
Copy link
Contributor

I guess there are several reasons, one of them is probably be that delta alters the number of lines because it adds headers and such. You'd want to have this done first, and then divide the output into pages.

@dandavison
Copy link
Owner

@bachue Note that delta also has a width setting that you can use to make lines extend beyond your terminal window if you want. But in general, the solution here is going to be #515.

Thanks @Kr1ss-XD. @kaldown as @Kr1ss-XD says, you can have any less configuration that you'd like in the less process that delta starts. You are also free to set pager = less | delta in gitconfig to experiment if you want!

@dandavison
Copy link
Owner

@kaldown Let us know here if you have any problem configuring the less process that delta starts.

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

4 participants