From 554012eb52264efd85db33a2def1c0fefe1ef701 Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Tue, 6 Apr 2021 16:44:59 -0400 Subject: [PATCH] Update search prompt, fix some buggy output formatting --- internal/editor/editor.go | 2 +- internal/terminal/io.go | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/internal/editor/editor.go b/internal/editor/editor.go index 2e6c12c..876da02 100644 --- a/internal/editor/editor.go +++ b/internal/editor/editor.go @@ -145,7 +145,7 @@ func (e *editor) find() { lastMatch := -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) { lastMatch = -1 direction = 1 diff --git a/internal/terminal/io.go b/internal/terminal/io.go index 0451ab5..82f7bfd 100644 --- a/internal/terminal/io.go +++ b/internal/terminal/io.go @@ -18,12 +18,7 @@ func ReadKey() (rune, int) { } // Print string to stdout -func Write(s string, a ...interface{}) { - fmt.Printf(s, a...) +func Write(s string) { + fmt.Print(s) } -func WriteLn(s string, a ...interface{}) { - str := fmt.Sprintf(s, a...) - - Write("%s\r\n", str) -}