-
Notifications
You must be signed in to change notification settings - Fork 476
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
modify the default chooser to use just --show
to preview
#1539
modify the default chooser to use just --show
to preview
#1539
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good! It looks like the tests are failing though.
Head branch was pushed to by a user without write access
Ok, test case has been fixed.
|
Cool ! |
Merged! Thank you for the PR! |
It's nice. Unfortunately, it doesn't work if the justfile is called something else than 'justfile' :-( For example:
doesn't display the recipes in the right pop-up window, but:
Note: This is the same behaviour for shebang just scripts (i.e. scripts starting with '#!/usr/bin/env -S just --justfile') Is there a workaround? Maybe a way to default to the old, plain fzf behaviour without --preview, when using --justfile or a just shebang script. I tried setting the environment variable CHOOSER_DEFAULT as follows:
but it didn't help. Many thanks, Steps to reproduce:
|
Also reported in #1638 |
The default chooser is fzf, and we pass it a command to generate the preview with "just --show" from the recipe name. This has been working well as long as we rely on the default justfile available in the directory, given that the preview command can find it too. However, passing "--chose" alongside "--justfile" to select a specific file results in the preview command not being able to find the right justfile to process. To address this issue, we turn the const string defining the preview command into a function that takes the internal representation of the justfile as an argument, and updates the preview command with the right file. Fixes: 5f9ac39 ("Use `just --show` in default chooser (casey#1539)")
The default chooser is fzf, and we pass it a command to generate the preview with "just --show" from the recipe name. This has been working well as long as we rely on the default justfile available in the directory, given that the preview command can find it too. However, passing "--chose" alongside "--justfile" to select a specific file results in the preview command not being able to find the right justfile to process. To address this issue, we turn the const string defining the preview command into a function that takes the internal representation of the justfile as an argument, and updates the preview command with the right file. Fixes: 5f9ac39 ("Use `just --show` in default chooser (casey#1539)") Suggested-by: Casey Rodarmor <casey@rodarmor.com>
The default chooser is fzf, and we pass it a command to generate the preview with "just --show" from the recipe name. This has been working well as long as we rely on the default justfile available in the directory, given that the preview command can find it too. However, passing "--chose" alongside "--justfile" to select a specific file results in the preview command not being able to find the right justfile to process. To address this issue, we turn the const string defining the preview command into a function that takes the internal representation of the justfile as an argument, and updates the preview command with the right file. Fixes: 5f9ac39 ("Use `just --show` in default chooser (casey#1539)") Suggested-by: Casey Rodarmor <casey@rodarmor.com>
The default chooser is fzf, and we pass it a command to generate the preview with "just --show" from the recipe name. This has been working well as long as we rely on the default justfile available in the directory, given that the preview command can find it too. However, passing "--chose" alongside "--justfile" to select a specific file results in the preview command not being able to find the right justfile to process. To address this issue, we turn the const string defining the preview command into a function that takes the internal representation of the justfile as an argument, and updates the preview command with the right file. Fixes: 5f9ac39 ("Use `just --show` in default chooser (casey#1539)") Suggested-by: Casey Rodarmor <casey@rodarmor.com>
The default chooser is fzf, and we pass it a command to generate the preview with "just --show" from the recipe name. This has been working well as long as we rely on the default justfile available in the directory, given that the preview command can find it too. However, passing "--chose" alongside "--justfile" to select a specific file results in the preview command not being able to find the right justfile to process. To address this issue, we turn the const string defining the preview command into a function that takes the internal representation of the justfile as an argument, and updates the preview command with the right file. Fixes: 5f9ac39 ("Use `just --show` in default chooser (casey#1539)") Suggested-by: Casey Rodarmor <casey@rodarmor.com>
The default chooser is fzf, and we pass it a command to generate the preview with "just --show" from the recipe name. This has been working well as long as we rely on the default justfile available in the directory, given that the preview command can find it too. However, passing "--chose" alongside "--justfile" to select a specific file results in the preview command not being able to find the right justfile to process. To address this issue, we turn the const string defining the preview command into a function that takes the internal representation of the justfile as an argument, and updates the preview command with the right file. Fixes: 5f9ac39 ("Use `just --show` in default chooser (casey#1539)") Suggested-by: Casey Rodarmor <casey@rodarmor.com>
Overwrite
CHOOSER_DEFAULT
:fzf
->fzf --preview 'just --show {}'