Merge pull request #2578 from MyGitUsername/master

Fix #2483: Alias descriptions are not tautological
This commit is contained in:
Oliver Blanthorn 2020-07-05 13:47:22 +01:00 committed by GitHub
commit bf90c10ed1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -68,13 +68,19 @@ export class ExcmdCompletionSource extends Completions.CompletionSourceFuse {
.map(([name, fn]) => new ExcmdCompletionOption(name, fn.doc)),
)
// Also add aliases to possible completions
const exaliases = Object.keys(config.get("exaliases")).filter(a =>
a.startsWith(exstr),
)
for (const alias of exaliases) {
// Also narrow down aliases map to possible completions
const exaliasesConfig = config.get("exaliases")
const exaliases = Object.keys(exaliasesConfig)
.filter(a => a.startsWith(exstr))
.reduce((obj, key) => {
obj[key] = exaliasesConfig[key]
return obj
}, {})
for (const alias of Object.keys(exaliases)) {
const cmd = aliases.expandExstr(alias, exaliases)
const fn = excmds.getFunction(cmd)
if (fn) {
this.options.push(
new ExcmdCompletionOption(