Use more appropriate action for Vim word completions (#28043)
Follow-up of https://github.com/zed-industries/zed/pull/26410 The action does not sort the items the way Vim does, but still better than the previous state. Release Notes: - N/A Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
This commit is contained in:
parent
2086f7d85b
commit
3f71ae9897
3 changed files with 8 additions and 8 deletions
|
@ -4377,7 +4377,7 @@ impl Editor {
|
|||
);
|
||||
|
||||
let words = match completion_settings.words {
|
||||
WordsCompletionMode::Disabled => Task::ready(HashMap::default()),
|
||||
WordsCompletionMode::Disabled => Task::ready(BTreeMap::default()),
|
||||
WordsCompletionMode::Enabled | WordsCompletionMode::Fallback => cx
|
||||
.background_spawn(async move {
|
||||
buffer_snapshot.words_in_range(WordsQuery {
|
||||
|
@ -4404,7 +4404,7 @@ impl Editor {
|
|||
|
||||
let sort_completions = provider
|
||||
.as_ref()
|
||||
.map_or(true, |provider| provider.sort_completions());
|
||||
.map_or(false, |provider| provider.sort_completions());
|
||||
|
||||
let filter_completions = provider
|
||||
.as_ref()
|
||||
|
@ -4421,7 +4421,7 @@ impl Editor {
|
|||
if let Some(provided_completions) = provided_completions.await.log_err().flatten() {
|
||||
completions.extend(provided_completions);
|
||||
if completion_settings.words == WordsCompletionMode::Fallback {
|
||||
words = Task::ready(HashMap::default());
|
||||
words = Task::ready(BTreeMap::default());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue