Skip to content

Commit

Permalink
Improve CLI performance
Browse files Browse the repository at this point in the history
  • Loading branch information
semperos committed Jul 25, 2024
1 parent c922429 commit adef454
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions cmd/ari/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -440,20 +440,15 @@ func (m candidate) DeleteLeft() int { return m.deleteLeft }

// Bubbline

const cliDefaultReflowWidth = 80

func cliEditorInitialize() *bubbline.Editor {
editor := bubbline.New()
editor.Placeholder = ""
editor.Reflow = func(x bool, y string, _ int) (bool, string, string) {
return editline.DefaultReflow(x, y, cliDefaultReflowWidth)
}
historyFile := viper.GetString("history")
if err := editor.LoadHistory(historyFile); err != nil {
fmt.Fprintf(os.Stderr, "Failed to load history, error: %v\n", err)
}
editor.SetAutoSaveHistory(historyFile, true)
editor.SetDebugEnabled(true)
editor.SetDebugEnabled(false)
editor.SetExternalEditorEnabled(true, "goal")
return editor
}

0 comments on commit adef454

Please sign in to comment.