From 6c9e52a8fdcf466eed76a6cac536b9e169b00628 Mon Sep 17 00:00:00 2001 From: Michael Lorant Date: Fri, 1 Mar 2024 02:29:45 +1100 Subject: [PATCH] Fix end of buffer character (#491) --- textarea/textarea.go | 5 +---- textarea/textarea_test.go | 32 ++++++++++++++++---------------- 2 files changed, 17 insertions(+), 20 deletions(-) diff --git a/textarea/textarea.go b/textarea/textarea.go index 991c803a..1d3aa97b 100644 --- a/textarea/textarea.go +++ b/textarea/textarea.go @@ -1138,10 +1138,7 @@ func (m Model) View() string { s.WriteString(prompt) displayLine++ - if m.ShowLineNumbers { - lineNumber := m.style.EndOfBuffer.Render(string(m.EndOfBufferCharacter)) - s.WriteString(lineNumber) - } + s.WriteString(m.style.EndOfBuffer.Render(string(m.EndOfBufferCharacter))) s.WriteRune('\n') } diff --git a/textarea/textarea_test.go b/textarea/textarea_test.go index d9776e6a..d37a74db 100644 --- a/textarea/textarea_test.go +++ b/textarea/textarea_test.go @@ -478,11 +478,11 @@ func TestView(t *testing.T) { }, expected: heredoc.Doc(` > the first line - > - > - > - > - > + > ~ + > ~ + > ~ + > ~ + > ~ `), }, { @@ -497,9 +497,9 @@ func TestView(t *testing.T) { > the first line > the second line > the third line - > - > - > + > ~ + > ~ + > ~ `), }, { @@ -547,11 +547,11 @@ func TestView(t *testing.T) { }, expected: heredoc.Doc(` > the first line - > - > - > - > - > + > * + > * + > * + > * + > * `), }, { @@ -567,9 +567,9 @@ func TestView(t *testing.T) { > the first line > the second line > the third line - > - > - > + > * + > * + > * `), }, {