fix(find): Strip excess ./ from file path prefix

This commit is contained in:
Michael Aaron Murphy 2022-03-28 00:59:48 +02:00 committed by Michael Murphy
parent f7823707fc
commit 90b5b229c2

View file

@ -126,7 +126,12 @@ impl SearchContext {
.map(|pos| line[pos + 1..].to_owned())
.unwrap_or_else(|| line.clone());
let description = ["~/", line.as_str()].concat();
let line = match line.strip_prefix("./") {
Some(line) => line,
None => line.as_str(),
};
let description = ["~/", line].concat();
let path = PathBuf::from(line);