fix: Use std::path::MAIN_SEPARATOR to determine completion
Refs #1439
commit3e4f81547c679619c96d0a6477ebf1d3badfe661
authorBlaž Hrastnik <blaz@mxxn.io>
dateThu 6 Jan 2022, 11:03 (5 years ago)
parentb18bda9
helix-term/src/ui/mod.rs+1−1
@@ -283,7 +283,7 @@ pub mod completers {
283283 let is_tilde = input.starts_with('~') && input.len() == 1;
284284 let path = helix_core::path::expand_tilde(Path::new(input));
285285
286− let (dir, file_name) = if input.ends_with('/') {
286+ let (dir, file_name) = if input.ends_with(std::path::MAIN_SEPARATOR) {
287287 (path, None)
288288 } else {
289289 let file_name = path
helix-term/src/ui/prompt.rs+1−1
@@ -473,7 +473,7 @@ impl Component for Prompt {
473473 }
474474 }
475475 key!(Enter) => {
476− if self.selection.is_some() && self.line.ends_with('/') {
476+ if self.selection.is_some() && self.line.ends_with(std::path::MAIN_SEPARATOR) {
477477 self.completion = (self.completion_fn)(&self.line);
478478 self.exit_selection();
479479 } else {