Update search prompt, fix some buggy output formatting
All checks were successful
timw4mail/gilo/pipeline/head This commit looks good

This commit is contained in:
Timothy Warren 2021-04-06 16:44:59 -04:00
parent 910107428c
commit 554012eb52
2 changed files with 3 additions and 8 deletions

View File

@ -145,7 +145,7 @@ func (e *editor) find() {
lastMatch := -1 lastMatch := -1
direction := 1 direction := 1
query := e.prompt("Search: %s (ESC to cancel)", func(query string, ch string) { query := e.prompt("Search: %s (Use ESC/Arrows/Enter)", func(query string, ch string) {
if ch == string(key.Enter) || ch == string(key.Esc) { if ch == string(key.Enter) || ch == string(key.Esc) {
lastMatch = -1 lastMatch = -1
direction = 1 direction = 1

View File

@ -18,12 +18,7 @@ func ReadKey() (rune, int) {
} }
// Print string to stdout // Print string to stdout
func Write(s string, a ...interface{}) { func Write(s string) {
fmt.Printf(s, a...) fmt.Print(s)
} }
func WriteLn(s string, a ...interface{}) {
str := fmt.Sprintf(s, a...)
Write("%s\r\n", str)
}