mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-08-04 10:18:16 +00:00
fix: use correct base directory for path completion (#854)
* fix wrong diff_path * refactor: simplify no base.parent()
This commit is contained in:
parent
6c342eb23e
commit
e2c8418c35
1 changed files with 5 additions and 1 deletions
|
@ -1562,7 +1562,11 @@ pub fn complete_path(
|
|||
// diff with root
|
||||
unix_slash(path.vpath().as_rooted_path())
|
||||
} else {
|
||||
let base = base.vpath().as_rooted_path();
|
||||
let base = base
|
||||
.vpath()
|
||||
.as_rooted_path()
|
||||
.parent()
|
||||
.unwrap_or(Path::new("/"));
|
||||
let path = path.vpath().as_rooted_path();
|
||||
let w = pathdiff::diff_paths(path, base)?;
|
||||
unix_slash(&w)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue