Skip to content

Commit

Permalink
fix(textarea): account for base styling frame when calculating width
Browse files Browse the repository at this point in the history
  • Loading branch information
maaslalani committed Jul 5, 2022
1 parent 588393f commit 2a2fb10
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions textarea/textarea.go
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,10 @@ func (m *Model) SetWidth(w int) {
if m.ShowLineNumbers {
inputWidth -= rw.StringWidth(fmt.Sprintf(m.lineNumberFormat, 0))
}

// Account for base style borders and padding.
inputWidth -= m.style.Base.GetHorizontalFrameSize()

inputWidth -= rw.StringWidth(m.Prompt)
m.width = clamp(inputWidth, minWidth, maxWidth)
}
Expand Down

0 comments on commit 2a2fb10

Please sign in to comment.