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

[bug] Invoke-PsFzfRipgrep custom $env:FZF_DEFAULT_COMMAND propagates to editor #267

Closed
DanSM-5 opened this issue Apr 16, 2024 · 0 comments · Fixed by #269
Closed

[bug] Invoke-PsFzfRipgrep custom $env:FZF_DEFAULT_COMMAND propagates to editor #267

DanSM-5 opened this issue Apr 16, 2024 · 0 comments · Fixed by #269

Comments

@DanSM-5
Copy link

DanSM-5 commented Apr 16, 2024

Description

Some of my custom keybindings that use fzf in (n)vim were not working properly under some circumstances. I tracked the issue down to the function Invoke-PsFzfRipgrep. It looks like the change to $env:FZF_DEFAULT_COMMAND with for the search string propagates to the call to Invoke-Expression -Command $cmd.

My keybinding was relaying on the $FZF_DEFAULT_COMMAND variable and it was breaking because of the above change.

Proposed solution

Calling $script:OverrideFzfDefaultCommand.Restore() right after the fzf command should prevent this issue and it should be fine to restore the command as the search has already been done.

Current workaround

Explicitly set $FZF_DEFAULT_COMMAND in my vimrc/init.vim to prevent the issue.

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 a pull request may close this issue.

1 participant