Change summary
internal/exp/diffview/diffview.go | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
Detailed changes
@@ -198,6 +198,9 @@ func (dv *DiffView) convertDiffToSplit() {
// adjustStyles adjusts adds padding and alignment to the styles.
func (dv *DiffView) adjustStyles() {
+ setPadding := func(s lipgloss.Style) lipgloss.Style {
+ return s.Padding(0, lineNumPadding).Align(lipgloss.Right)
+ }
dv.style.MissingLine.LineNumber = setPadding(dv.style.MissingLine.LineNumber)
dv.style.DividerLine.LineNumber = setPadding(dv.style.DividerLine.LineNumber)
dv.style.EqualLine.LineNumber = setPadding(dv.style.EqualLine.LineNumber)
@@ -217,10 +220,6 @@ func (dv *DiffView) detectNumDigits() {
}
}
-func setPadding(s lipgloss.Style) lipgloss.Style {
- return s.Padding(0, lineNumPadding).Align(lipgloss.Right)
-}
-
// detectCodeWidth calculates the maximum width of code lines in the diff view.
func (dv *DiffView) detectCodeWidth() {
switch dv.layout {