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

Allow specifying '{n}' as the OFFSET in the preview-window flag #4079

Merged
merged 2 commits into from
Nov 4, 2024

Conversation

jaydee-coder
Copy link
Contributor

@jaydee-coder jaydee-coder commented Nov 4, 2024

This feature can be useful in scrolling to the selected line in the preview window.

For example, it can be used to use fzf as a quick filtering tool for large files while keeping an eye on the selected line as it shows up in the original file.

Example usage:

man fzf | tee /tmp/tmp.log | fzf \
  --reverse \
  --exact \
  --query 'position' \
  --preview 'bat --force-colorization /tmp/tmp.log --highlight-line $(({n}+1))' \
  --preview-window '+{n}/2'

src/options.go Outdated Show resolved Hide resolved
@junegunn junegunn merged commit d4d9b99 into junegunn:master Nov 4, 2024
5 checks passed
@junegunn
Copy link
Owner

junegunn commented Nov 4, 2024

Merged, thanks!

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.

2 participants