Closed ram-on closed 2 years ago
Thank you for good suggestion.
I implemented the test version as the issue2
branch.
To test the new feature, please execute go get github.com/nyaosorg/go-readline-ny@issue2
, modify and rebuild your application.
editor := readline.Editor{
Prompt: func() (int, error) { return fmt.Print("$ ") },
Writer: colorable.NewColorableStdout(),
History: history,
Coloring: &coloring.VimBatch{},
HistoryCycling: true, // [New flag]
}
When the field .HistoryCycling
is false (zero value), the history cycling is disabled (default).
When it is true, the history cycling is enabled.
If you consider the specification OK, and no ones refused, then I will merge it into the default branch and make a new release.
Hello, I've just tested out the issue2
branch and it's working brilliantly. Many thanks!
Ok. I would merge. Thank you !
Thank you for this project.
Feature request: assume that a user has inputted the following through
editor.ReadLine()
function:If the user presses the UP arrow key for 4 times, than "Morning" will be redisplayed.
Most probably this is due to the following code within
history.go
Would it be possible to implement a flag such that, when enabled, if the user presses the UP key >= 4, then only the first input (i.e. "Hello") is displayed?