diff --git a/pkg/gocui/view.go b/pkg/gocui/view.go index 0485f2e48..10e620cd4 100644 --- a/pkg/gocui/view.go +++ b/pkg/gocui/view.go @@ -2263,8 +2263,7 @@ func (v *View) ClearTextArea() { func (v *View) overwriteLines(y int, content string) { // break by newline, then for each line, write it, then add that erase command - v.buf.wx = 0 - v.buf.wy = y + v.SetWritePos(0, y) v.clearViewLines() lines := strings.ReplaceAll(content, "\n", "\x1b[K\n") diff --git a/pkg/gocui/view_test.go b/pkg/gocui/view_test.go index 58b98e01d..f559e562b 100644 --- a/pkg/gocui/view_test.go +++ b/pkg/gocui/view_test.go @@ -121,10 +121,7 @@ func TestOverwriteLinesAfterContentEndingInANewline(t *testing.T) { v.OverwriteLines(0, "x") - /* EXPECTED: assert.Equal(t, []string{"x", "b"}, v.BufferLines()) - ACTUAL: */ - assert.Equal(t, []string{"a", "x"}, v.BufferLines()) } func TestUpdatedCursorAndOrigin(t *testing.T) {