-
Notifications
You must be signed in to change notification settings - Fork 406
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Command line option to apply line number style to unchanged lines #219
Conversation
f9eafbb
to
118f472
Compare
Thanks @clnoll! That screenshot is very compelling. I agree with this plan and I think I'd have realized soon that I wanted this also. The option name So, let me have a go at justifying to myself what we have: When it comes to hunk lines, we're using the terms
Then, from #190, we have
So, I think I'm happy with all that. Even though the identified sections are horizontal in the first case and vertical in the second, it seems to be consistent with the basic idea that there's a "minus file" (old file) and a "plus file" (new file). When it comes to line number display, it seems we have 2 dimensions and a maximum of 6 things that could have names and distinct styles:
So it's like we're using And finally, in this PR, we want to choose a name for What do you think? The only thing I've come up with so far is to add two new options
That sort of makes sense as representing indexing into a 2D array, with the first index identifying the column? And leaves open the possibility of adding options for the other things with logical names if that were ever desired ( Or is there another way of looking at it that yields a simpler set of names? There are a couple of related thoughts that aren't really the concern of this PR but I'll mention anyway:
|
118f472
to
d4bc5c2
Compare
d4bc5c2
to
6086a33
Compare
Thanks for the suggestions, I agree re the inconsistency of row vs. column. I have a slightly different proposal, now that I've played around with the options a bit. The first version of the numbers options conflates the concept of minus/left and plus/right, because it colors all numbers in a column, even if the row that the number is associated with was removed or added (aka a zero-row). I think we should alter the behavior of We can then add separate options for styling by entire column ( The last changes I'd propose would be to have the format strings & corresponding styles be left/right column-based ( |
BTW I'd love to make the placeholders That being said, let me know if you'd prefer to use something else for the placeholders. |
Thanks for thinking about this @clnoll! I think your proposal is better than mine: I agree with everything you wrote in your last two comments. |
eba8c0a
to
fe5e882
Compare
bf114c1
to
66d7eac
Compare
This is looking great. I've pushed a commit that starts adding (high-level) tests for this branch. 3 are passing and one is failing. I've added the tests in a new file |
c0fc8e1
to
43f4282
Compare
Thanks again @clnoll! I've added some tests and changed the command line interface as discussed.
|
43f4282
to
21f88ab
Compare
Adds
--number-zero-style
option that overrides--number-minus-style
and--number-plus-style
on unchanged lines if--number
is set.This gives the ability to draw attention to line numbers for changed lines by deemphasizing the numbers for unchanged lines, e.g.: