Skip to content

Commit

Permalink
fix(textarea): end of buffer alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
maaslalani committed Feb 28, 2024
1 parent e985ec9 commit c94f0cc
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 31 deletions.
4 changes: 2 additions & 2 deletions textarea/textarea.go
Original file line number Diff line number Diff line change
Expand Up @@ -1139,7 +1139,7 @@ func (m Model) View() string {
displayLine++

if m.ShowLineNumbers {
lineNumber := m.style.EndOfBuffer.Render((fmt.Sprintf(m.lineNumberFormat, string(m.EndOfBufferCharacter))))
lineNumber := m.style.EndOfBuffer.Render(string(m.EndOfBufferCharacter))
s.WriteString(lineNumber)
}
s.WriteRune('\n')
Expand Down Expand Up @@ -1193,7 +1193,7 @@ func (m Model) placeholderView() string {
s.WriteString(prompt)

if m.ShowLineNumbers {
eob := m.style.EndOfBuffer.Render((fmt.Sprintf(m.lineNumberFormat, string(m.EndOfBufferCharacter))))
eob := m.style.EndOfBuffer.Render(string(m.EndOfBufferCharacter))
s.WriteString(eob)
}
}
Expand Down
58 changes: 29 additions & 29 deletions textarea/textarea_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -429,11 +429,11 @@ func TestView(t *testing.T) {
name: "placeholder",
expected: heredoc.Doc(`
> 1 Hello, World!
> ~
> ~
> ~
> ~
> ~
> ~
> ~
> ~
> ~
> ~
`),
},
{
Expand All @@ -445,11 +445,11 @@ func TestView(t *testing.T) {
},
expected: heredoc.Doc(`
> 1 the first line
> ~
> ~
> ~
> ~
> ~
> ~
> ~
> ~
> ~
> ~
`),
},
{
Expand All @@ -463,9 +463,9 @@ func TestView(t *testing.T) {
> 1 the first line
> 2 the second line
> 3 the third line
> ~
> ~
> ~
> ~
> ~
> ~
`),
},
{
Expand Down Expand Up @@ -512,11 +512,11 @@ func TestView(t *testing.T) {
},
expected: heredoc.Doc(`
> 1 the first line
> *
> *
> *
> *
> *
> *
> *
> *
> *
> *
`),
},
{
Expand All @@ -531,9 +531,9 @@ func TestView(t *testing.T) {
> 1 the first line
> 2 the second line
> 3 the third line
> *
> *
> *
> *
> *
> *
`),
},
{
Expand Down Expand Up @@ -582,11 +582,11 @@ func TestView(t *testing.T) {
},
expected: heredoc.Doc(`
* 1 the first line
* ~
* ~
* ~
* ~
* ~
* ~
* ~
* ~
* ~
* ~
`),
},
{
Expand All @@ -601,9 +601,9 @@ func TestView(t *testing.T) {
* 1 the first line
* 2 the second line
* 3 the third line
* ~
* ~
* ~
* ~
* ~
* ~
`),
},
}
Expand Down

0 comments on commit c94f0cc

Please sign in to comment.