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

Fix autocompletion for paths with period #5175

Merged

Conversation

DylanBulfin
Copy link
Contributor

Fix for #5136

Bug has to do with how the file_name method deals with paths ending in . or /.. I hardcoded the value for file_name for paths ending in /. and paths that only consist of a single period, and updated the logic for path.

Updated bug fix
@the-mikedavis the-mikedavis added C-bug Category: This is a bug A-helix-term Area: Helix term improvements S-waiting-on-review Status: Awaiting review from a maintainer. labels Dec 15, 2022
Some(path) if !path.as_os_str().is_empty() => path.to_path_buf(),
// Path::new("h")'s parent is Some("")...
_ => std::env::current_dir().expect("couldn't determine current directory"),
let is_period = (input.ends_with("/.") && input.len() > 2) || input == ".";
Copy link
Member

Choose a reason for hiding this comment

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

Should this use std::path::MAIN_SEPARATOR instead of hardcoding /?

Copy link
Member

@dead10ck dead10ck left a comment

Choose a reason for hiding this comment

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

Ok this seems fine to me 👍

@archseer archseer merged commit c4b0eb8 into helix-editor:master Jan 9, 2023
kirawi pushed a commit to kirawi/helix that referenced this pull request Jan 25, 2023
* Bug fix

Updated bug fix

* Simplified conditionals

* Switched to use path separator constant
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-helix-term Area: Helix term improvements C-bug Category: This is a bug S-waiting-on-review Status: Awaiting review from a maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants