-
Notifications
You must be signed in to change notification settings - Fork 82
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
[Search directory] expand variables in current token #133
Merged
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
262a39b
[Search files] expand entire token
kidonng 05dffd1
That thing
kidonng 2e29c3e
Use expaned token in the preview
kidonng b6b60bd
Fix escaping
kidonng e24052f
eval is evil
kidonng ecbe926
Try to fix test
kidonng 231ec29
🤷♀️
kidonng b87a24b
fix typo
kidonng 5fa321b
Save a escape
kidonng eeedadb
Update __fzf_search_current_dir.fish
kidonng ed6f2c7
Merge branch 'main' into expand-token
PatrickF1 b4b4186
Escape properly
kidonng f81af52
Quote the new eval as well
kidonng 1617780
Merge branch 'main' into expand-token
kidonng 43d131f
Merge
kidonng 931c052
Fix space
kidonng 78c43a7
Update __fzf_search_current_dir.fish
kidonng 5f30c49
Update __fzf_search_current_dir.fish
kidonng 0b8975b
start test
PatrickF1 6957773
Merge branch 'main' into expand-token
PatrickF1 62b26e1
work on new test
PatrickF1 62d97cd
finish test
PatrickF1 d8d3f1e
add timeout to tests
PatrickF1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
set target "file 1.txt" | ||
|
||
set --global fzf_dir_opts --select-1 | ||
mock commandline --current-token "echo \$target" | ||
mock commandline "--current-token --replace --" "echo \$argv" | ||
mock commandline \* "" | ||
# string unescape because the args passed into commandline --current-token --replace are escaped | ||
set actual (string unescape (__fzf_search_current_dir)) | ||
|
||
@test "expands variables in current token" (basename $actual) = $target |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
What's an example where removing the quotes would break this?
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.
I'm just quoting it like in
__fzf_preview_file
.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.
I just can't think of when token when ever be separated by an unescaped space. Whatever, I suppose it's safer this way.
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.
You are totally right... I was too careful to do it right.
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.
Oh shoot, this is actually a bug. Quoting it broke this for tilde. Just tested.
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.
Fixed in 83cb78f