Skip to content

Commit

Permalink
Add text to language completer
Browse files Browse the repository at this point in the history
  • Loading branch information
A-Walrus authored and archseer committed Sep 10, 2022
1 parent 01ee42b commit cc47d3f
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions helix-term/src/ui/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,13 +330,19 @@ pub mod completers {
pub fn language(editor: &Editor, input: &str) -> Vec<Completion> {
let matcher = Matcher::default();

let mut matches: Vec<_> = editor
let text: String = "text".into();

let language_ids = editor
.syn_loader
.language_configs()
.filter_map(|config| {
.map(|config| &config.language_id)
.chain(std::iter::once(&text));

let mut matches: Vec<_> = language_ids
.filter_map(|language_id| {
matcher
.fuzzy_match(&config.language_id, input)
.map(|score| (&config.language_id, score))
.fuzzy_match(language_id, input)
.map(|score| (language_id, score))
})
.collect();

Expand Down

0 comments on commit cc47d3f

Please sign in to comment.