-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Feature request: Ability to display current line position and matched item count in fzf info #3866
Comments
This made me realize that we're not firing Lines 1241 to 1259 in ed12925
But there's no reason that it should be this way. I can't remember why I made that decision. Maybe I was worried about ending up with too many events? Maybe it was just an oversight.
While I agree that an alternative representation is desirable in some cases, we should think through how to implement it and Something like e.g. How to hide surrounding parentheses and brackets when the inner element evaluates to an empty string? We don't want to see |
Thanks for considering this a feature.
So, some kind of conditional syntax would be needed? Below are some syntax examples for conditionals: zsh: ternary expressionIn # Display a different string based on whether the hour is six
print -Pr -- "%(6T.Breakfast is ready.No Breakfast)"
# Print a Thumbs Up emoji or a Cross Mark emoji based on the exit status of the last command
print -Pr -- "%(?.👍.❌)" go: if…endOr maybe gh api repos/junegunn/fzf \
--template '{{ if not .private }}Stars: {{ .stargazers_count }}{{ end }}'
git
git for-each-ref --sort=-creatordate \
--format='%(if)%(HEAD)%(then)%(color:magenta)%(refname:short)%(color:reset)%(else)%(color:yellow)%(refname)%(color:reset)%(end)' 'refs/heads' But a state for multi mode would be needed to check if it is enabled or not. However, the longer and more complex it becomes to write, the less likely anyone will actually use it. What do you think about some kind of conditional syntax for strings as seen above? Footnotes |
On second thought, I'm afraid we would end up with a very complex solution for little demand. Shelling out seems like the most practical solution for now. Now that the How about adding something like |
It would allow for customizing the info, and the syntax is straightforward and easy to use. I like it. |
Added |
All transform actions have the same problem. To allow CTRL-C, we should restore the terminal state to receive user input, but immediately doing so would cause unwanted artifacts to be rendered on screen during the execution. For example, if you hold down CTRL-K or up arrow during a transform action, you would see: > ^K^K^K^[[A^[[A^[[A One idea is to receive user input when a certain amount of time has elapsed, e.g. 1 second, assuming that most transform commands finish within the period. |
Checklist
man fzf
)Output of
fzf --version
0.53.0 (brew)
OS
Shell
Problem / Steps to reproduce
Intro
Currently, the info looks like in the image below, displaying the matched count and the total count, as well as the number of selections in multi mode.
---Feature Description
Ability to display the current line position and the number of matched items.
The request can be hacked together with the current flags by using the
--border
or the--header
to display the desired infos.Note
The above image is just to better illustrate the request and not a good solution, as the matched count doesn't incrementally update itself in batches in the same way as the current info does on large inputs.
The name of the flag could be
--info2=STYLE
.Related
Projects which inspired this request.
The text was updated successfully, but these errors were encountered: