feat: prefer exact match when completion mode is prefix
This commit is contained in:
parent
8707d14f95
commit
bf3b6c7a84
|
@ -14,7 +14,7 @@ use std::path::{
|
||||||
is_separator, Component, Path, PathBuf, MAIN_SEPARATOR as SEP, MAIN_SEPARATOR_STR,
|
is_separator, Component, Path, PathBuf, MAIN_SEPARATOR as SEP, MAIN_SEPARATOR_STR,
|
||||||
};
|
};
|
||||||
|
|
||||||
use super::SortBy;
|
use super::{MatchAlgorithm, SortBy};
|
||||||
|
|
||||||
#[derive(Clone, Default)]
|
#[derive(Clone, Default)]
|
||||||
pub struct PathBuiltFromString {
|
pub struct PathBuiltFromString {
|
||||||
|
@ -76,6 +76,12 @@ fn complete_rec(
|
||||||
completions.push(built);
|
completions.push(built);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if entry_name.eq(base)
|
||||||
|
&& matches!(options.match_algorithm, MatchAlgorithm::Prefix)
|
||||||
|
&& isdir
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
None => {
|
None => {
|
||||||
completions.push(built);
|
completions.push(built);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user