mirror of
https://github.com/vale981/tridactyl
synced 2025-03-05 17:41:40 -05:00
Comment alias autocomplete implementation
This commit is contained in:
parent
92cdb3a5f4
commit
eb57556e09
1 changed files with 3 additions and 0 deletions
|
@ -150,8 +150,11 @@ clInput.addEventListener("input", () => {
|
||||||
var newCmd = undefined
|
var newCmd = undefined
|
||||||
|
|
||||||
// Hacky implementation of aliases for autocompletions
|
// 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+/)
|
let [func,...args] = exstr.trim().split(/\s+/)
|
||||||
if (func in Config.get("exaliases")) {
|
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])
|
newCmd = exstr.replace(func, Config.get("exaliases")[func])
|
||||||
} else {
|
} else {
|
||||||
newCmd = exstr
|
newCmd = exstr
|
||||||
|
|
Loading…
Add table
Reference in a new issue