Skip to content

Commit a7813df

Browse files
committed
feature: add option/alt left right for moving cursor one word Fixes #25
1 parent baa70c6 commit a7813df

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

cmd/rootShell.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
var ShellCmd = &cobra.Command{
1515
Use: "bit",
1616
Short: "Bit is a Git CLI that predicts what you want to do",
17-
Long: `v0.6.0`,
17+
Long: `v0.6.1`,
1818
Run: func(cmd *cobra.Command, args []string) {
1919
completerSuggestionMap, bitCmdMap := CreateSuggestionMap(cmd)
2020

@@ -137,7 +137,7 @@ func GitCommandsPromptUsed(args []string, suggestionMap map[string][]prompt.Sugg
137137
// expected usage format
138138
// bit (checkout|switch|co) [-b] branch-name
139139
if args[len(args)-1] == "--version" {
140-
fmt.Println("bit version v0.6.0")
140+
fmt.Println("bit version v0.6.1")
141141
}
142142
if isBranchCompletionCommand(sub) {
143143
branchName := ""

cmd/util.go

+9-1
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,14 @@ func SuggestionPrompt(prefix string, completer func(d prompt.Document) []prompt.
338338
Key: prompt.ControlC,
339339
Fn: exit,
340340
}),
341+
prompt.OptionAddASCIICodeBind(prompt.ASCIICodeBind{
342+
ASCIICode: []byte{0x1b, 0x62},
343+
Fn: prompt.GoLeftWord,
344+
}),
345+
prompt.OptionAddASCIICodeBind(prompt.ASCIICodeBind{
346+
ASCIICode: []byte{0x1b, 0x66},
347+
Fn: prompt.GoRightWord,
348+
}),
341349
)
342350
branchName := strings.TrimSpace(result)
343351
if strings.HasPrefix(result, "origin/") {
@@ -362,7 +370,7 @@ func HandleExit() {
362370
fmt.Println(v)
363371
fmt.Println(string(debug.Stack()))
364372
fmt.Println("OS:", runtime.GOOS, runtime.GOARCH)
365-
fmt.Println("bit version v0.6.0")
373+
fmt.Println("bit version v0.6.1")
366374
printGitVersion()
367375

368376
}

0 commit comments

Comments
 (0)