-
Notifications
You must be signed in to change notification settings - Fork 411
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
🚀 Optional line wrapping #299
Comments
I am seeing the same issue as referred by @augustobmoura - pretty much a standard Ubuntu 20.04 installation with the git/delta config:
delta is of version 0.4.1. |
Hi all, thanks for this. I agree implementing line wrapping like bat does would be a nice feature. I don't think I'm going to be able to work on this in the near future so I'd welcome a pull request and am also happy to discuss what the code change might involve. Some notes: There's a couple of related aspects to this:
In normal mode we don't lose content today, it's just that it's not wrapped prettily in line-numbers mode. Personally I have the However in side-by-side mode we currently lose content, because we can't allow the left panel to flow into the right panel's area and I did not attempt to implement line wrapping in the initial implementation of side-by-side because it would have been made the code change significantly more complicated than it already was. It's maybe worth noting that in side-by-side mode, it is possible to have the panels use up more horizontal space than your terminal window has, by setting Perhaps some of this could be helpful in the README. |
@kevinhwang91 can you give a full example of a diff that you can't display in the way you want, and show the delta settings you're using? Note that we do have
|
It works, could delta adjust its value by the |
This doesn't seem to work in the git config files @kevinhwang91 - but I can achieve it with git -c "core.pager=delta --max-line-length=$((COLUMNS - 10))" <git-subcommand> Note that I needed to subtract 10 because the columns for the line numbers seem not to be included in the max-line-length that delta calculates. Depending on your configuration for line-number formatting, this might be a value smaller or greater than 10. I agree it would be nice if delta could take the current terminal width into account. Besides |
Thanks, but I think I'm encountering an issue for delta, @dandavison , it seems that |
I have tried auto line-wrapping algorithm implemented in #515, it works very well. cc @th1000s, you have implemented line-wrapping in side-by-side mode, Could you please also take a look at the implementation of the line-wrapping algorithm in the non-side-by-side mode? Thanks very much! |
Line wrapping by default for some languages like LaTeX would be extremely helpful. I find it quite annoying to do manual linebreaks for natural language paragraphs, where I want all lines to be of similar length (this is very different to source code of course). Line wrapping in text editors does exactly that. For now I'm using |
Thanks for delta! I really love it but I really miss this feature since I don't use side-by-side mode to make it fit better in VSCode. Have you thought more of this @dandavison @th1000s ? |
Sorry if this is repeated. I didn't find any similar issues.
Currently, when the line length exceeds its column, an arrow indicates that the line continues

I wish we could wrap the line like
bat
currently does and keep the diff highlighting.Bat with line wrapping

The text was updated successfully, but these errors were encountered: