Skip to content

Commit

Permalink
Fix end of buffer character (#491)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikelorant committed Feb 29, 2024
1 parent 6ebf50e commit 6c9e52a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 20 deletions.
5 changes: 1 addition & 4 deletions textarea/textarea.go
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}

Expand Down
32 changes: 16 additions & 16 deletions textarea/textarea_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -478,11 +478,11 @@ func TestView(t *testing.T) {
},
expected: heredoc.Doc(`
> the first line
>
>
>
>
>
> ~
> ~
> ~
> ~
> ~
`),
},
{
Expand All @@ -497,9 +497,9 @@ func TestView(t *testing.T) {
> the first line
> the second line
> the third line
>
>
>
> ~
> ~
> ~
`),
},
{
Expand Down Expand Up @@ -547,11 +547,11 @@ func TestView(t *testing.T) {
},
expected: heredoc.Doc(`
> the first line
>
>
>
>
>
> *
> *
> *
> *
> *
`),
},
{
Expand All @@ -567,9 +567,9 @@ func TestView(t *testing.T) {
> the first line
> the second line
> the third line
>
>
>
> *
> *
> *
`),
},
{
Expand Down

0 comments on commit 6c9e52a

Please sign in to comment.