Skip to content

Commit

Permalink
feature: add option/alt left right for moving cursor one word Fixes #25
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswalz committed Oct 14, 2020
1 parent baa70c6 commit a7813df
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cmd/rootShell.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
var ShellCmd = &cobra.Command{
Use: "bit",
Short: "Bit is a Git CLI that predicts what you want to do",
Long: `v0.6.0`,
Long: `v0.6.1`,
Run: func(cmd *cobra.Command, args []string) {
completerSuggestionMap, bitCmdMap := CreateSuggestionMap(cmd)

Expand Down Expand Up @@ -137,7 +137,7 @@ func GitCommandsPromptUsed(args []string, suggestionMap map[string][]prompt.Sugg
// expected usage format
// bit (checkout|switch|co) [-b] branch-name
if args[len(args)-1] == "--version" {
fmt.Println("bit version v0.6.0")
fmt.Println("bit version v0.6.1")
}
if isBranchCompletionCommand(sub) {
branchName := ""
Expand Down
10 changes: 9 additions & 1 deletion cmd/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,14 @@ func SuggestionPrompt(prefix string, completer func(d prompt.Document) []prompt.
Key: prompt.ControlC,
Fn: exit,
}),
prompt.OptionAddASCIICodeBind(prompt.ASCIICodeBind{
ASCIICode: []byte{0x1b, 0x62},
Fn: prompt.GoLeftWord,
}),
prompt.OptionAddASCIICodeBind(prompt.ASCIICodeBind{
ASCIICode: []byte{0x1b, 0x66},
Fn: prompt.GoRightWord,
}),
)
branchName := strings.TrimSpace(result)
if strings.HasPrefix(result, "origin/") {
Expand All @@ -362,7 +370,7 @@ func HandleExit() {
fmt.Println(v)
fmt.Println(string(debug.Stack()))
fmt.Println("OS:", runtime.GOOS, runtime.GOARCH)
fmt.Println("bit version v0.6.0")
fmt.Println("bit version v0.6.1")
printGitVersion()

}
Expand Down

0 comments on commit a7813df

Please sign in to comment.