From 4b93b2a2355d1d74254b8910b7b1b19d5840012a Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 3 Jun 2018 20:52:01 -0400 Subject: Fix typo in filename --- go/src/lib/statusline/statusline.go | 33 +++++++++++++++++++++++++++++++++ go/src/lib/statusline/statuslinue.go | 33 --------------------------------- 2 files changed, 33 insertions(+), 33 deletions(-) create mode 100644 go/src/lib/statusline/statusline.go delete mode 100644 go/src/lib/statusline/statuslinue.go diff --git a/go/src/lib/statusline/statusline.go b/go/src/lib/statusline/statusline.go new file mode 100644 index 0000000..bedf952 --- /dev/null +++ b/go/src/lib/statusline/statusline.go @@ -0,0 +1,33 @@ +package statusline + +import ( + "fmt" + "io" +) + +type StatusLine interface { + Put(line string) + End(keep bool) +} + +type statusLine struct { + out io.Writer + prevLen int +} + +func New(out io.Writer) StatusLine { + return &statusLine{out: out} +} + +func (sl *statusLine) Put(line string) { + fmt.Fprintf(sl.out, "\r%-[1]*[2]s", sl.prevLen, line) + sl.prevLen = len(line) +} + +func (sl *statusLine) End(keep bool) { + if keep { + io.WriteString(sl.out, "\n") + } else { + fmt.Fprintf(sl.out, "\r%-[1]*[2]s\r", sl.prevLen, "") + } +} diff --git a/go/src/lib/statusline/statuslinue.go b/go/src/lib/statusline/statuslinue.go deleted file mode 100644 index bedf952..0000000 --- a/go/src/lib/statusline/statuslinue.go +++ /dev/null @@ -1,33 +0,0 @@ -package statusline - -import ( - "fmt" - "io" -) - -type StatusLine interface { - Put(line string) - End(keep bool) -} - -type statusLine struct { - out io.Writer - prevLen int -} - -func New(out io.Writer) StatusLine { - return &statusLine{out: out} -} - -func (sl *statusLine) Put(line string) { - fmt.Fprintf(sl.out, "\r%-[1]*[2]s", sl.prevLen, line) - sl.prevLen = len(line) -} - -func (sl *statusLine) End(keep bool) { - if keep { - io.WriteString(sl.out, "\n") - } else { - fmt.Fprintf(sl.out, "\r%-[1]*[2]s\r", sl.prevLen, "") - } -} -- cgit v1.2.3-2-g168b