diff options
author | ChrHorn | 2022-11-17 01:16:03 +0000 |
---|---|---|
committer | GitHub | 2022-11-17 01:16:03 +0000 |
commit | 322e957ea1947108d10699f217b75b831df2a2c0 (patch) | |
tree | 1db5a266799843d1c4b5668ed47a0e9b6d42a40f /helix-term/src | |
parent | 7483c762229516298c4a2d9398b9418dbc57198b (diff) |
Remove prefix filtering from autocomplete menu (#4578)
PR #4134 switched the autocomplete menu from alphabetical to fuzzy
sorting. This commit removes the still existing filtering by prefix and
should enable full fuzzy sorting of the autocomplete menu.
closes #3084, #1807
Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
Diffstat (limited to 'helix-term/src')
-rw-r--r-- | helix-term/src/commands.rs | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 2f2427ec..4e3f0767 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -3950,7 +3950,6 @@ pub fn completion(cx: &mut Context) { iter.reverse(); let offset = iter.take_while(|ch| chars::char_is_word(*ch)).count(); let start_offset = cursor.saturating_sub(offset); - let prefix = text.slice(start_offset..cursor).to_string(); cx.callback( future, @@ -3960,7 +3959,7 @@ pub fn completion(cx: &mut Context) { return; } - let mut items = match response { + let items = match response { Some(lsp::CompletionResponse::Array(items)) => items, // TODO: do something with is_incomplete Some(lsp::CompletionResponse::List(lsp::CompletionList { @@ -3970,15 +3969,6 @@ pub fn completion(cx: &mut Context) { None => Vec::new(), }; - if !prefix.is_empty() { - items.retain(|item| { - item.filter_text - .as_ref() - .unwrap_or(&item.label) - .starts_with(&prefix) - }); - } - if items.is_empty() { // editor.set_error("No completion available"); return; |