improve autocomplete

This commit is contained in:
Aidan 2020-07-18 14:19:58 -07:00
parent d5edb2bad2
commit 956044cfae
No known key found for this signature in database
GPG key ID: 327711E983899316
3 changed files with 19 additions and 9 deletions

View file

@ -20,7 +20,6 @@ package main
import (
"os"
"fmt"
"strings"
"strconv"
"github.com/peterh/liner"
"gitlab.com/whom/shs/ast"
@ -108,8 +107,7 @@ func main() {
line.SetCtrlCAborts(true)
line.SetCompleter(func(line string) (c []string) {
strtoks := strings.Split(line, " ")
return util.ShellCompleter(strtoks[len(strtoks) - 1], vars, funcs)
return util.ShellCompleter(line, vars, funcs)
})
var histFile *os.File