Skip to content

Commit

Permalink
fix: Use std::path::MAIN_SEPARATOR to determine completion
Browse files Browse the repository at this point in the history
Refs #1439
  • Loading branch information
archseer committed Jan 6, 2022
1 parent b18bda9 commit 3e4f815
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion helix-term/src/ui/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ pub mod completers {
let is_tilde = input.starts_with('~') && input.len() == 1;
let path = helix_core::path::expand_tilde(Path::new(input));

let (dir, file_name) = if input.ends_with('/') {
let (dir, file_name) = if input.ends_with(std::path::MAIN_SEPARATOR) {
(path, None)
} else {
let file_name = path
Expand Down
2 changes: 1 addition & 1 deletion helix-term/src/ui/prompt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ impl Component for Prompt {
}
}
key!(Enter) => {
if self.selection.is_some() && self.line.ends_with('/') {
if self.selection.is_some() && self.line.ends_with(std::path::MAIN_SEPARATOR) {
self.completion = (self.completion_fn)(&self.line);
self.exit_selection();
} else {
Expand Down

0 comments on commit 3e4f815

Please sign in to comment.