Skip to content
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

Make it possible to jump between files when navigate is active #684

Merged
merged 3 commits into from Aug 21, 2021

Conversation

dandavison
Copy link
Owner

Fixes #680 cc @tjkirch @lepotic

This changes the labels that delta adds when navigate = true: we now have an upper-case delta on file boundaries, and a lower-case delta on hunk boundaries:

image

As suggested by @lepotic #680 (comment), this allows us to switch to navigating by file with / <up> <left> <backspace> <backspace> <enter>.

In other words, using / <up> to reveal the current search regex:

/^(commit|added:|removed:|renamed:|Δ|δ)

and then editing this to remove the lower-case delta:

/^(commit|added:|removed:|renamed:|Δ)

and finally resuming search with <enter>.

The labels can be modified. E.g.

[delta]
    file-modified-label = @
    hunk-label = *

(and it is ok to use something like * which has special meaning in regular expressions).

@dandavison dandavison merged commit 130b0b6 into master Aug 21, 2021
@dandavison dandavison deleted the 680-navigate-hunk-label branch August 21, 2021 01:34
Kr1ss-XD added a commit to Kr1ss-XD/delta that referenced this pull request Aug 22, 2021
* upstream/master:
  Refactor: use Option to model sometimes-null highlighter (dandavison#698)
  Add some test coverage for truncate_str with a multibyte unicode character
  Use "syntax theme" terminology in show-syntax-themes output (dandavison#697)
  Fix deadlock in `git diff` mode (dandavison#695)
  Fix empty line highlighting (dandavison#642)
  Revert "Add failing test that gitconfig insteadOf is honored"
  Add failing test that gitconfig insteadOf is honored
  Support `insteadOf` replacements in git remote URLs
  Hold GitConfig in main Config struct
  Revert "Support `insteadOf` replacements in git remote URLs"
  Support `insteadOf` replacements in git remote URLs
  Refactoring for dandavison#693 (dandavison#696)
  Make it possible to jump between files when navigate is active (dandavison#684)
  Bump dev version number
  Compile delta from source in dockerfile
  Fix computed values to be computed after all set_options (dandavison#690)
  Remove unnecessary borrows (dandavison#692)
  Bump bitflags from 1.3.1 to 1.3.2 (dandavison#691)
  Bump git2 from 0.13.20 to 0.13.21 (dandavison#687)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🚀 Keybinding to jump between files in navigate mode
1 participant