mirror of
https://github.com/nushell/nushell.git
synced 2024-11-24 17:34:00 +01:00
Add PWD-per-drive support for completion
This commit is contained in:
parent
22a7e46891
commit
a3a01ed4a9
@ -158,6 +158,12 @@ pub fn complete_item(
|
||||
) -> Vec<(nu_protocol::Span, String, Option<Style>)> {
|
||||
let cleaned_partial = surround_remove(partial);
|
||||
let isdir = cleaned_partial.ends_with(is_separator);
|
||||
#[cfg(windows)]
|
||||
let cleaned_partial = if let Some(absoluted_partial) = nu_path::expand_pwd(PathBuf::from(cleaned_partial.clone()).as_path()) {
|
||||
absoluted_partial.display().to_string()
|
||||
} else {
|
||||
cleaned_partial
|
||||
};
|
||||
let expanded_partial = expand_ndots(Path::new(&cleaned_partial));
|
||||
let should_collapse_dots = expanded_partial != Path::new(&cleaned_partial);
|
||||
let mut partial = expanded_partial.to_string_lossy().to_string();
|
||||
|
Loading…
Reference in New Issue
Block a user