From 48cfdd0862105a98b8127e1a1f5e23cafe282e09 Mon Sep 17 00:00:00 2001 From: atrbgithub <14765982+atrbgithub@users.noreply.github.com> Date: Tue, 6 Dec 2022 10:09:05 +0000 Subject: [PATCH] Include patch from the following PR: https://github.com/gosuri/uilive/pull/33 --- go.mod | 2 +- writer.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 80083d8..1c985a4 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ -module github.com/gosuri/uilive +module github.com/atrbgithub/uilive go 1.10 diff --git a/writer.go b/writer.go index d76542a..47b89d5 100644 --- a/writer.go +++ b/writer.go @@ -90,11 +90,11 @@ func (w *Writer) Flush() error { lines++ currentLine.Reset() } else { - currentLine.Write([]byte{b}) - if overFlowHandled && currentLine.Len() > termWidth { + if overFlowHandled && currentLine.Len() >= termWidth { lines++ currentLine.Reset() } + currentLine.Write([]byte{b}) } } w.lineCount = lines @@ -170,4 +170,4 @@ func (n *newline) Write(p []byte) (int, error) { n.writer.mtx.Lock() defer n.writer.mtx.Unlock() return n.writer.buf.Write(p) -} \ No newline at end of file +}