From 0f6e11084ce25b9dd40a13c873cd53d5b9ec1e97 Mon Sep 17 00:00:00 2001 From: Michael Lorant Date: Sat, 1 Jun 2024 17:21:15 +1000 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A8=20Replace=20deprecated=20style=20c?= =?UTF-8?q?opy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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]: https://github.com/charmbracelet/lipgloss/pull/289 --- internal/ui/body/style.go | 2 +- internal/ui/filterlist/style.go | 2 +- internal/ui/header/style.go | 4 ++-- internal/ui/option/theme/style.go | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/ui/body/style.go b/internal/ui/body/style.go index 529e637..0a9b176 100644 --- a/internal/ui/body/style.go +++ b/internal/ui/body/style.go @@ -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(). diff --git a/internal/ui/filterlist/style.go b/internal/ui/filterlist/style.go index 0061ef8..7b516c0 100644 --- a/internal/ui/filterlist/style.go +++ b/internal/ui/filterlist/style.go @@ -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(). diff --git a/internal/ui/header/style.go b/internal/ui/header/style.go index f2d122c..9504573 100644 --- a/internal/ui/header/style.go +++ b/internal/ui/header/style.go @@ -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(). @@ -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(). diff --git a/internal/ui/option/theme/style.go b/internal/ui/option/theme/style.go index 427581a..76bf81d 100644 --- a/internal/ui/option/theme/style.go +++ b/internal/ui/option/theme/style.go @@ -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(). @@ -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