-
Notifications
You must be signed in to change notification settings - Fork 405
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
🐛 --navigate
breaks git log --oneline
and empty git diff
#237
Comments
Hi @SimenB, thanks for this report also. I am not sure yet what to do about the way |
For the |
The latest release of delta allows
This is motivated by the fact that leaving |
I've found some less tricks: https://superuser.com/a/1626732/33415 Another thing aggravating this is the navigate regexp only matches git mode output. |
@cben thanks very much for posting this. So do you think a change to delta code is warranted? Can you help me make sure I'm getting this right? I've made a very quick PR: #526 The diff there is - process.args(&["--pattern", &navigate::make_navigate_regexp(&config)]);
+ process.args(&[format!("+r/{}", navigate::make_navigate_regexp(&config))]); Or did you intend for delta to use the
I have some tangential questions that you might be able to help with:
|
In addition to the
This requires delta 0.6.0. |
Ack, you don't want |
I just checked, and both
You might be able to configure less prompts to show it constantly. But for debugging, just press / Up arrow and you'll see it. |
Oooh, here is a weird idea (which is maybe what you were getting at): don't pass a pattern to This has several benefits when the diff is short, including --quit-if-one-screen compatibility, and not filling the screen _until you press n or N. Simply appending doesn't work; the format is not quite documented, need We could make
Normally that exits immediately with no visible output, but that's an illusion — it wrote to the "alternate buffer" and switched back too fast to notice. Proof: Don't have time to play more with this now. This is promising, but also increasingly fragile and ideally needs explicit flags for the desired search behavior in |
Neat! OK, this is sounding promising, let's keep playing around with this as we have time. Maybe it would help to use the env var |
The latest commit in #526 implements your suggestion, i.e. |
transient less history file — not sure, would mean that inside |
Found upstream issue, brain-dumped there: gwsw/less#28. Re-discovered a simpler idea 🤣: buffer the output, count lines yourself. Instead of relying on |
Yes you're probably right that this would frustrate more sophisticated less users: delta's less process should be able to recall previous less searches. It's a detail, but seeing as the delta search regex is an implementation detail of As you say, this locating and writing to files on disk at start up is a bit inelegant/fragile but I think as long as whatever we do is hidden behind the |
This should be fixed by #526 which implements @cben's idea (#237 (comment)). So should be in the next release. If anyone's able to build on master and confirm that would be great (especially Windows). Thanks @cben! |
Thanks @cben and @dandavison! Very clever! This fixes a long standing annoyance I had with |
Yep, this works great now. Thanks! |
Hi all. The solution we settled here is great, apart from one thing. Over the last few years, I've increasingly come to realize that it's very inconvenient to not share history between less when used as a git pager vs normal less usage. At least two other people on the planet agree: #1261 I'm currently using #1844 which is a quick hack that causes delta to just use the less history file, and accept that when using less normally (or via bat, etc) the history is polluted with delta's navigate regexes. Any better ideas? cc @adamchainz |
Clean repo and running
git diff
Running
git log --oneline
gives same error.Note that in both cases hitting
Enter
will make it print out the correct stuff (which makes #234 really obvious)The text was updated successfully, but these errors were encountered: