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

Setting EDITOR does nothing: Can't define any other editor #246

Closed
redactedscribe opened this issue Jan 31, 2024 · 4 comments · Fixed by #247
Closed

Setting EDITOR does nothing: Can't define any other editor #246

redactedscribe opened this issue Jan 31, 2024 · 4 comments · Fixed by #247

Comments

@redactedscribe
Copy link

Setting EDITOR to $Env:EDITOR = 'codium --goto ":0"' and running Invoke-FuzzyEdit outputs Executing ''....

No matter what EDITOR is set to, the output is always blank as shown above.

Not setting EDITOR the output is Executing 'code --goto "C:\{snip}.txt:0"'... but this is no use to me as I do no use VS Code but VSCodium.

Thanks.

PSFzf 2.5.19
fzf 0.46.0
PowerShell v7.4.1

@kelleyma49
Copy link
Owner

kelleyma49 commented Feb 2, 2024

I can see in the code where it's broken! I will try to fix it in the next couple of days

kelleyma49 added a commit that referenced this issue Feb 2, 2024
- $env:EDITOR and $ENV:VISUAL are now respected properly if the editor is unknown
- Resolves #246
kelleyma49 added a commit that referenced this issue Feb 2, 2024
- $env:EDITOR and $ENV:VISUAL are now respected properly if the editor is unknown
- Resolves #246
@redactedscribe
Copy link
Author

Thanks for the fix @kelleyma49. The variable can now be set. However I have an issue:

Unset:

Executing 'code --goto "D:\Dev\New Text Document.txt:0"'...

After setting env variables:

$Env:EDITOR = 'codium --goto ":0"'
$Env:PSFZF_EDITOR_OPTIONS = 'test'

('code --goto ":0"' was the default before the latest update so I just changed it to codium.)

You can see that the file path comes last, unlike when EDITOR is unset (above):

Executing 'codium --goto ":0" test "D:\Dev\New Text Document.txt"'...`
# Error:
Arguments in `--goto` mode should be in the format of `FILE(:LINE(:CHARACTER))`.

I'm not sure how to set EDITOR to get the following output (using PSFZF_EDITOR_OPTIONS as seen above wouldn't help as it come before the file path):

Executing 'codium --goto "D:\Dev\New Text Document.txt:0"'...` 

Is there some file path variable for PSFzf that I can use between --goto and ":0"?

Thanks.

@kelleyma49
Copy link
Owner

@redactedscribe , I've added support for detecting codium so you don't have to set editor options. See #248

@redactedscribe
Copy link
Author

Thanks @kelleyma49! I'll report back if it works for me.

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.

2 participants