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

Convert Windows style path separator in completers to Unix style #1389

Merged
merged 1 commit into from
Dec 29, 2021

Conversation

ath3
Copy link
Contributor

@ath3 ath3 commented Dec 27, 2021

The addition of shellwords included support for escaping, which breaks windows style paths in the prompt.
This change converts backslashes to slashes for directories if helix is on windows.
According to the video in the issue tracker, unix style paths work fine there too.

I couldnt test this.

Issue #1380

@ath3
Copy link
Contributor Author

ath3 commented Dec 28, 2021

Its now confirmed this fixes the issue.

Comment on lines +334 to +336
let path = if cfg!(windows) && is_dir {
// Convert Windows style path separator to Unix style
path.to_str().unwrap().replace("\\", "/")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why only do it if it is a directory?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because only directories end with a path separator
for example:

    file:       file.ext
    directory:  directory\

@archseer archseer merged commit 49444f9 into helix-editor:master Dec 29, 2021
archseer added a commit that referenced this pull request Jan 5, 2022
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 this pull request may close these issues.

3 participants