From 2ede1a195f5078bdf5cff4d86410d679bedbe7d8 Mon Sep 17 00:00:00 2001 From: TorchedSammy <38820196+TorchedSammy@users.noreply.github.com> Date: Mon, 6 Dec 2021 20:52:49 -0400 Subject: [PATCH] chore: remove test completion code --- go.sum | 2 ++ rl_readline-go.go | 67 +---------------------------------------------- 2 files changed, 3 insertions(+), 66 deletions(-) diff --git a/go.sum b/go.sum index 04b19ad..d4f14b9 100644 --- a/go.sum +++ b/go.sum @@ -38,6 +38,8 @@ github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27k github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU= github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/maxlandon/readline v0.1.0-beta.0.20211027085530-2b76cabb8036 h1:wJMb6UBj7BSW8dquwo7Hyli7SQ2QmjT4L0xKgIyWy08= +github.com/maxlandon/readline v0.1.0-beta.0.20211027085530-2b76cabb8036/go.mod h1:Yzn6jb/68429mQI+aAVOD9yPFnpl2ZYwWien8gBnupo= github.com/olekukonko/ts v0.0.0-20171002115256-78ecb04241c0 h1:LiZB1h0GIcudcDci2bxbqI6DXV8bF8POAnArqvRrIyw= github.com/olekukonko/ts v0.0.0-20171002115256-78ecb04241c0/go.mod h1:F/7q8/HZz+TXjlsoZQQKVYvXTZaFH4QRa3y+j1p7MS0= github.com/pborman/ansi v1.0.0 h1:OqjHMhvlSuCCV5JT07yqPuJPQzQl+WXsiZ14gZsqOrQ= diff --git a/rl_readline-go.go b/rl_readline-go.go index 94610e9..24a1550 100644 --- a/rl_readline-go.go +++ b/rl_readline-go.go @@ -21,73 +21,8 @@ type lineReader struct { // other gophers might hate this naming but this is local, shut up func newLineReader(prompt string) *lineReader { rl := readline.NewInstance() - rl.TabCompleter = func(line []rune, pos int, dtx readline.DelayedTabContext) (string, []*readline.CompletionGroup) { - var items = []string{ - "abaya", - "abomasum", - "absquatulate", - "adscititious", - "afreet", - "Albertopolis", - "alcazar", - "amphibology", - "amphisbaena", - "anfractuous", - "anguilliform", - "apoptosis", - "apple-knocker", - "argle-bargle", - "Argus-eyed", - "argute", - "ariel", - "aristotle", - "aspergillum", - "astrobleme", - "Attic", - "autotomy", - "badmash", - "bandoline", - "bardolatry", - "Barmecide", - "barn", - "bashment", - "bawbee", - "benthos", - "bergschrund", - "bezoar", - "bibliopole", - "bichon", - "bilboes", - "bindlestiff", - "bingle", - "blatherskite", - "bleeding", - "blind", - "bobsy-die", - "boffola", - "boilover", - "borborygmus", - "breatharian", - "Brobdingnagian", - "bruxism", - "bumbo", -} - var suggestions []string - - for i := range items { - if strings.HasPrefix(items[i], string(line)) { - suggestions = append(suggestions, items[i][pos:]) - } - } - - return string(line[pos:]), []*readline.CompletionGroup{ - { - Suggestions: suggestions, - }, - } - } - rl.Multiline = true + return &lineReader{ rl, }