Skip to content

Commit

Permalink
馃毃 Replace deprecated style copy
Browse files Browse the repository at this point in the history
The `lipgloss` package has [deprecated][1] the use of style copying
using the `Copy` method.

The documentation has been updated to provide an alternative approach:

> to copy just use assignment (i.e. a := b). All methods also return a
> new style.

This change applies the recommendation.

[1]: charmbracelet/lipgloss#289
  • Loading branch information
mikelorant committed Jun 1, 2024
1 parent be130ef commit 0f6e110
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion internal/ui/body/style.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func defaultStyles(th theme.Theme) Styles {
BorderForeground(clr.Boundary).
Padding(0, 1, 0, 1)

s.focusBoundary = s.boundary.Copy().
s.focusBoundary = s.boundary.
BorderForeground(clr.FocusBoundary)

s.textAreaPlaceholder = lipgloss.NewStyle().
Expand Down
2 changes: 1 addition & 1 deletion internal/ui/filterlist/style.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func defaultStyles(th theme.Theme) Styles {
BorderStyle(lipgloss.NormalBorder()).
BorderForeground(clr.Boundary)

s.focusBoundary = s.boundary.Copy().
s.focusBoundary = s.boundary.
BorderForeground(clr.FocusBoundary)

s.paginatorBoundary = lipgloss.NewStyle().
Expand Down
4 changes: 2 additions & 2 deletions internal/ui/header/style.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func defaultStyles(th theme.Theme) Styles {
BorderStyle(lipgloss.NormalBorder()).
BorderForeground(clr.EmojiBoundary)

s.emojiFocusBoundary = s.emojiBoundary.Copy().
s.emojiFocusBoundary = s.emojiBoundary.
BorderForeground(clr.EmojiFocusBoundary)

s.summaryBoundary = lipgloss.NewStyle().
Expand All @@ -64,7 +64,7 @@ func defaultStyles(th theme.Theme) Styles {
BorderStyle(lipgloss.NormalBorder()).
BorderForeground(clr.SummaryBoundary)

s.summaryFocusBoundary = s.summaryBoundary.Copy().
s.summaryFocusBoundary = s.summaryBoundary.
BorderForeground(clr.SummaryFocusBoundary)

s.counterDivider = lipgloss.NewStyle().
Expand Down
4 changes: 2 additions & 2 deletions internal/ui/option/theme/style.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func defaultStyles(th theme.Theme) Styles {
Padding(0, 1, 0, 1).
MarginBottom(1)

s.themeTitleFocus = s.themeTitle.Copy().
s.themeTitleFocus = s.themeTitle.
BorderForeground(clr.TitleFocus)

s.themeTitleLabel = lipgloss.NewStyle().
Expand All @@ -43,7 +43,7 @@ func defaultStyles(th theme.Theme) Styles {
Width(40).
BorderForeground(clr.Boundary)

s.themeListBoundaryFocus = s.themeListBoundary.Copy().
s.themeListBoundaryFocus = s.themeListBoundary.
BorderForeground(clr.BoundaryFocus)

return s
Expand Down

0 comments on commit 0f6e110

Please sign in to comment.