-
Notifications
You must be signed in to change notification settings - Fork 393
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
Would it be possible to add a line number sidebar? #130
Comments
Hi @eth-p, thanks for your work on bat! Yes, this makes sense and is doable and there have been a few requests for it. There are a couple of design decisions I see: in delta's case (unlike bat) we have line numbers in the previous version and the new version. So, do we emulate (e.g.) GitLab and GitHub's two-column line number display, and is there an argument for a single-column line number display showing line numbers in the new version only, and what is the default going to be. (When implementing, we need to be careful with the terminal-width accounting; people's customized |
That's definitely a pretty tough decision to make. Personally, I would be find a two column display like this to work for me (and line numbers could be dimmed where aren't any changes):
I'm not sure how you have printing implemented with
If you don't mind leaving it up to the user, you could change |
Thanks, that looks like a very reasonable design.
I think we're good on that front. Delta works on one diff hunk at a time, so it knows the starting line number, and it has to read it all into memory before emitting anything in order to do the within-line edit detection between candidate matching pairs of plus and minus lines.
Yes, although it would be a breaking change, bat's solution seems nice to me. Also, as a general rule I've been making delta consistent with bat wherever that makes sense, with the intention that it can be a complementary app, taking over from bat for highlighting diff output. (E.g. delta honors |
Delta now has line numbers ( Line numbersUse The numbers are displayed in two columns and there are several configuration options: see the Custom featuresAll delta options can go under the [delta]
features = unobtrusive-line-numbers decorations
whitespace-error-style = 22 reverse
[delta "unobtrusive-line-numbers"]
line-numbers = true
line-numbers-minus-style = "#444444"
line-numbers-zero-style = "#444444"
line-numbers-plus-style = "#444444"
line-numbers-left-format = "{nm:>4}┊"
line-numbers-right-format = "{np:>4}│"
line-numbers-left-style = blue
line-numbers-right-style = blue
[delta "decorations"]
commit-decoration-style = bold yellow box ul
file-style = bold yellow ul
file-decoration-style = none
hunk-header-decoration-style = yellow box |
Thanks for the amazing work on delta!
Do you think it would be possible to add an optional line number sidebar similar to the one that
bat
has? Ifdelta
had something like that, I think it could really help when there are large multi-line hunks where it's impractical to count past the first twenty or so lines.The text was updated successfully, but these errors were encountered: