mirror of
https://github.com/Maks1mS/bubbles.git
synced 2025-10-10 14:16:41 +03:00
fix(textarea): account for base styling frame when calculating width
This commit is contained in:
@@ -673,6 +673,10 @@ func (m *Model) SetWidth(w int) {
|
|||||||
if m.ShowLineNumbers {
|
if m.ShowLineNumbers {
|
||||||
inputWidth -= rw.StringWidth(fmt.Sprintf(m.lineNumberFormat, 0))
|
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)
|
inputWidth -= rw.StringWidth(m.Prompt)
|
||||||
m.width = clamp(inputWidth, minWidth, maxWidth)
|
m.width = clamp(inputWidth, minWidth, maxWidth)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user