improve autocomplete
This commit is contained in:
parent
d5edb2bad2
commit
956044cfae
3 changed files with 19 additions and 9 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue