on master help sign in
fix: Use std::path::MAIN_SEPARATOR to determine completion
3e4f815Blaž Hrastnik
helix-term/src/ui/mod.rs+1−1
@@ -283,7 +283,7 @@ pub mod completers {
283 let is_tilde = input.starts_with('~') && input.len() == 1;
283 let is_tilde = input.starts_with('~') && input.len() == 1;
284 let path = helix_core::path::expand_tilde(Path::new(input));
284 let path = helix_core::path::expand_tilde(Path::new(input));
285
285
286− let (dir, file_name) = if input.ends_with('/') {
286+ let (dir, file_name) = if input.ends_with(std::path::MAIN_SEPARATOR) {
287 (path, None)
287 (path, None)
288 } else {
288 } else {
289 let file_name = path
289 let file_name = path
helix-term/src/ui/prompt.rs+1−1
@@ -473,7 +473,7 @@ impl Component for Prompt {
473 }
473 }
474 }
474 }
475 key!(Enter) => {
475 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) {
477 self.completion = (self.completion_fn)(&self.line);
477 self.completion = (self.completion_fn)(&self.line);
478 self.exit_selection();
478 self.exit_selection();
479 } else {
479 } else {