Comments (4)
Seeing the same in delta 0.17.0
from delta.
I'm a bit annoyed by this as well. Jumping to the next hunk is usually such a small jump that scrolling with Ctrl+D/U already is more than good enough. And it's especially annoying with large files like lock files.
But this behavior is documented in the Features list of the README.md (even though it's missing from the docs):
n
andN
keybindings to move between files in large diffs, and between diffs inlog -p
views (--navigate
)
There are 2 options to fix this:
- Set
--hunk-label ""
to an empty string. Or via~/.gitconfig
:hunk-label =
(just nothing).
This removes theβ’
from the beginning of every hunk, but that's totally fine for me. π€· - Set the
--navigate-regex
value to not search for the hunk labels.
~/.git/config
:navigate-regex = ^(commit|added:|removed:|renamed:|Ξ)
But this assumes that you didn't change any of the configs that go intonavigate-regex
by default, like--file-added-label
etc, sincenavigate-regex
is actually built from all those options, seedelta/src/features/navigate.rs
Lines 51 to 58 in 0f8a2f0
So if you ever change any of these options, you'll need to manually change thenavigate-regex
option to reflect that as well. Otherwise this seems like the cleanest option.
from delta.
Just want to say that I sympathise with this! I also find that if I'm using navigate to jump, then by-hunk jumps often feel too small. So I'm open to interface design change proposals here.
A related variant is to increase our diff context, i.e. with git ... -U99 | delta
or
[diff]
context = 99
If we set that number large enough, then there are no within-file hunks any longer hence navigate jumps become by-file! Of course it can sometimes not be exactly what you want to have to scroll past large sections of unchanged content, but sometimes the lack of hunk breaks makes diffs easier to understand.
from delta.
@dandavison Good idea with setting a wider context. I'll definitely play around with increasing it a bit, even though 99 seems way too high for me personally. I'll set it to 9 and see how I like it, which will still reduce some hunks hopefully.
IMO The best way would be to have multiple search patterns, that you can search via different hotkeys.
For example something like n
/ N
just for hunk jumps, c
/ C
for commits, f
/ F
for files etc.
That way the user can use whatever jumps make the most sense for their current use case.
But since delta uses plain old less, this isn't really possible afaik.
I could almost emulate this behavior with custom terminal hotkeys (I use WezTerm), so that my terminal inputs the correct search pattern for whatever navigation "mode" I want to use.
So for example pressing Ctrl+Shift+H could send the following key strokes to the terminal and therefore set less' search pattern to "hunks only": /^(β’)β΅
And then just use n
/N
as always.
And then have other hotkeys for other common navigation/search patterns I use.
from delta.
Related Issues (20)
- RUSTSEC-2024-0320: yaml-rust is unmaintained.
- π Incorrect syntax-highlight with comment tag "#"
- π [Docs] Show the default config values HOT 1
- π Extra newline before diffs
- π Empty diff for proc files
- [Feature Request] Show percentage of how far the entire diff has been read
- `git grep -l` replaces first `-` with a `:` HOT 1
- Not working in Ubuntu 22.04 as intendedπ
- π inserted/deleted blank lines are sometimes hard to see
- Specify light and dark themes simultaneously, and auto-switch based on system appearance HOT 1
- π ripgrep JSON output causes panic with UTF character
- π PAGER env variable will omit command line parameters
- Weird EOL characters in side-by-side diff output ( ^[[0K )
- π Mouse scroll not working in jetbrains ide's terminal
- π output using html <ins> and <del> tags
- π Printing special terminal control characters "^[]11;rgb:0000/0000/0000^G" HOT 2
- π Memory allocation error for non root user HOT 1
- π Dark theme doesn't seem to be working HOT 2
- π Show when a directory as a whole was renamed, instead of each file inside it
- some tests fail with unicode-width v0.1.13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from delta.