From dc45ff2728d85e25fd599ce002c3f2f738d7ff54 Mon Sep 17 00:00:00 2001 From: maxlandon Date: Sat, 19 Aug 2023 17:06:41 +0200 Subject: [PATCH] Imports formatting & fixes --- commands/readline/bind.go | 5 +++-- commands/readline/commands.go | 3 ++- commands/readline/completers.go | 5 +++-- commands/readline/export.go | 3 ++- commands/readline/set.go | 7 ++++--- completer.go | 3 ++- menu.go | 3 ++- 7 files changed, 18 insertions(+), 11 deletions(-) diff --git a/commands/readline/bind.go b/commands/readline/bind.go index a370360..2af32de 100644 --- a/commands/readline/bind.go +++ b/commands/readline/bind.go @@ -6,10 +6,11 @@ import ( "os" "strings" - "github.com/reeflective/readline" - "github.com/reeflective/readline/inputrc" "github.com/rsteube/carapace" "github.com/spf13/cobra" + + "github.com/reeflective/readline" + "github.com/reeflective/readline/inputrc" ) // Bind returns a command named `bind`, for manipulating readline keymaps and bindings. diff --git a/commands/readline/commands.go b/commands/readline/commands.go index e3ec1bf..cb89c6c 100644 --- a/commands/readline/commands.go +++ b/commands/readline/commands.go @@ -1,8 +1,9 @@ package readline import ( - "github.com/reeflective/readline" "github.com/spf13/cobra" + + "github.com/reeflective/readline" ) // Commands returns a command named `readline`, with subcommands dedicated diff --git a/commands/readline/completers.go b/commands/readline/completers.go index c384db2..135a121 100644 --- a/commands/readline/completers.go +++ b/commands/readline/completers.go @@ -22,10 +22,11 @@ import ( "fmt" "strings" - "github.com/reeflective/readline" - "github.com/reeflective/readline/inputrc" "github.com/rsteube/carapace" "github.com/spf13/cobra" + + "github.com/reeflective/readline" + "github.com/reeflective/readline/inputrc" ) func completeKeymaps(sh *readline.Shell, _ *cobra.Command) carapace.Action { diff --git a/commands/readline/export.go b/commands/readline/export.go index 0030f15..67f70e9 100644 --- a/commands/readline/export.go +++ b/commands/readline/export.go @@ -23,9 +23,10 @@ import ( "sort" "strings" + "github.com/spf13/cobra" + "github.com/reeflective/readline" "github.com/reeflective/readline/inputrc" - "github.com/spf13/cobra" ) const ( diff --git a/commands/readline/set.go b/commands/readline/set.go index 39c1e51..7f8f49b 100644 --- a/commands/readline/set.go +++ b/commands/readline/set.go @@ -5,20 +5,21 @@ import ( "strconv" "strings" - "github.com/reeflective/readline" - "github.com/reeflective/readline/inputrc" "github.com/rsteube/carapace" "github.com/rsteube/carapace/pkg/style" "github.com/spf13/cobra" "golang.org/x/exp/maps" "golang.org/x/exp/slices" + + "github.com/reeflective/readline" + "github.com/reeflective/readline/inputrc" ) var ( // We here must assume that all bind changes during the lifetime // of the binary are all made by a single readline application. // This config only stores the vars/binds that have been changed. - cfgChanged = inputrc.Config{} + cfgChanged = inputrc.NewConfig() ) // Set returns a command named `set`, for manipulating readline global options. diff --git a/completer.go b/completer.go index 374c6ea..ad65fad 100644 --- a/completer.go +++ b/completer.go @@ -10,10 +10,11 @@ import ( "unicode" "unicode/utf8" - "github.com/reeflective/readline" "github.com/rsteube/carapace" "github.com/rsteube/carapace/pkg/style" "github.com/rsteube/carapace/pkg/xdg" + + "github.com/reeflective/readline" ) func (c *Console) complete(line []rune, pos int) readline.Completions { diff --git a/menu.go b/menu.go index 2159719..14ed949 100644 --- a/menu.go +++ b/menu.go @@ -9,8 +9,9 @@ import ( "sync" "text/template" - "github.com/reeflective/readline" "github.com/spf13/cobra" + + "github.com/reeflective/readline" ) // Menu - A menu is a simple way to seggregate commands based on