-
Notifications
You must be signed in to change notification settings - Fork 361
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
🐛 Why is there a line number in the hunk header when code line numbers are enabled (and more)? #494
Comments
Hi @erikhuizinga, thanks for this. Short answer: to disable the line number in the hunk header (but retain the file path), use
That was my first thought also and in fact I initially implemented it that way. However, (a) the line number in the hunk header as
Yes, as you say, it's a git thing: if we decide to retain the line number in the hunk header, we have to get used to thinking of it as "Your hunk starts at these coordinates. By the way, here is a line of code that I have identified as probably helping you see the indentation context (e.g. function, class) in which your hunk lies. But the coordinates are not of that line of code; it is somewhere above."
Ha, it's a bit of an edge case isn't it :) I think when I was writing the code I played around with conditional inclusion of the colon. But no, I think it's OK to keep the colon there for consistency, especially as tools such as iTerm2 semantic history have regexps recognizing the standard The relevant section in
|
Thanks for you elaborate answer. It looks like I might have to look into a different shell app to try such clicking to editor/IDE features! Closing as answered and already addressed/considered. |
No problem. Some possibilities that you might want to investigate are
Err, I don't mean to plug random projects of mine, this just happens to be something I've played with. The hyperlinks spec seems promising for terminal emulators. |
I get it: you're a shell/terminal hacker and you like it. I like the tools that people like you produce, so no worries! Thanks for pointing this out. It will only prove helpful to others. 👍 |
Relevant Git config:
When running
git diff 0.5.0...0.5.1
on the delta repository, this is the output in my shell (raw Git diff below):Raw Git diff
git --no-pager diff 0.5.0...0.5.1
(only the corresponding part)
Note the 2 hunk headers:
This leads to my questions/issues:
Here's another screenshot followed by the raw Git diff, this time using
git diff 0.5.0...0.5.1 -- *.rs
:Raw Git diff
git --no-pager diff 0.5.0...0.5.1 -- *.rs
(only the corresponding part)
The text was updated successfully, but these errors were encountered: