mirror of
https://github.com/vale981/tridactyl
synced 2025-03-05 17:41:40 -05:00
Excmds completion allow partial match at the middle
This commit is contained in:
parent
32500c86ae
commit
a1717e740f
1 changed files with 9 additions and 0 deletions
|
@ -90,6 +90,15 @@ export class ExcmdCompletionSource extends Completions.CompletionSourceFuse {
|
|||
}
|
||||
}
|
||||
|
||||
// Add partial matched funcs like: 'conf' ~= 'viewconfig'
|
||||
const seen = new Set(this.options.map(o => o.value))
|
||||
const partial_options = this.scoreOptions(
|
||||
fns
|
||||
.filter(([name, fn]) => !fn.hidden && name.includes(exstr) && !seen.has(name))
|
||||
.map(([name, fn]) => new ExcmdCompletionOption(name, fn.doc)),
|
||||
)
|
||||
this.options = this.options.concat(partial_options)
|
||||
|
||||
this.options.forEach(o => (o.state = "normal"))
|
||||
return this.updateChain()
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue