From a767fa369c0683ca8c590664cecfb766171deb9d Mon Sep 17 00:00:00 2001 From: JT <547158+jntrnr@users.noreply.github.com> Date: Fri, 11 Feb 2022 09:42:15 -0500 Subject: [PATCH] Improve quote path completions with drill-down (#4422) --- crates/nu-cli/src/completions.rs | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/crates/nu-cli/src/completions.rs b/crates/nu-cli/src/completions.rs index 34d8887b87..453cc594ec 100644 --- a/crates/nu-cli/src/completions.rs +++ b/crates/nu-cli/src/completions.rs @@ -362,21 +362,11 @@ fn file_path_completion( ) -> Vec<(nu_protocol::Span, String)> { use std::path::{is_separator, Path}; - let partial = if let Some(s) = partial.strip_prefix('"') { - s - } else { - partial - }; - - let partial = if let Some(s) = partial.strip_suffix('"') { - s - } else { - partial - }; + let partial = partial.replace("\"", ""); let (base_dir_name, partial) = { // If partial is only a word we want to search in the current dir - let (base, rest) = partial.rsplit_once(is_separator).unwrap_or((".", partial)); + let (base, rest) = partial.rsplit_once(is_separator).unwrap_or((".", &partial)); // On windows, this standardizes paths to use \ let mut base = base.replace(is_separator, &SEP.to_string());