Comment alias autocomplete implementation

This commit is contained in:
Isaac Khor 2017-12-28 18:49:20 +08:00
parent 92cdb3a5f4
commit eb57556e09

View file

@ -150,8 +150,11 @@ clInput.addEventListener("input", () => {
var newCmd = undefined
// Hacky implementation of aliases for autocompletions
// Replaced an alias with its command defined in `config.ts` if it exists
let [func,...args] = exstr.trim().split(/\s+/)
if (func in Config.get("exaliases")) {
// JS by default only replaces the first occurence of the searchstr,
// so this should only replace the command and nothing else
newCmd = exstr.replace(func, Config.get("exaliases")[func])
} else {
newCmd = exstr