nu-cli/completions: fix file completions with quotes (#5242)

* nu-cli/completions: fix file completions with quotes

* wrap with backticks
This commit is contained in:
Herlon Aguiar
2022-04-20 06:54:37 +02:00
committed by GitHub
parent 4d7b86f278
commit c0ce1e9057

View File

@ -136,6 +136,11 @@ pub fn file_path_completion(
path = format!("\'{}\'", path);
}
// Fix files or folders with quotes
if path.contains('\'') || path.contains('"') {
path = format!("`{}`", path);
}
Some((span, path))
} else {
None