repos / pico

pico services - prose.sh, pastes.sh, imgs.sh, feeds.sh, pgs.sh
git clone https://github.com/picosh/pico.git

commit
cc73b0f
parent
5548864
author
Antonio Mika
date
2024-05-31 14:04:30 +0000 UTC
Fix lint
7 files changed,  +11, -11
M pastes/parser.go
+1, -1
1@@ -26,7 +26,7 @@ func ParseText(filename string, text string) (string, error) {
2 		return text, err
3 	}
4 	var buf bytes.Buffer
5-	err = formatter.Format(&buf, styles.Dracula, iterator)
6+	err = formatter.Format(&buf, styles.Get("dracula"), iterator)
7 	if err != nil {
8 		return text, err
9 	}
M tui/common/styles.go
+4, -4
 1@@ -51,7 +51,7 @@ func DefaultStyles(renderer *lipgloss.Renderer) Styles {
 2 
 3 	s.Cursor = renderer.NewStyle().Foreground(Fuschia)
 4 	s.Wrap = renderer.NewStyle().Width(58)
 5-	s.Paragraph = s.Wrap.Copy().Margin(1, 0, 0, 2)
 6+	s.Paragraph = s.Wrap.Margin(1, 0, 0, 2)
 7 	s.Logo = renderer.NewStyle().
 8 		Foreground(Cream).
 9 		Background(Indigo).
10@@ -64,10 +64,10 @@ func DefaultStyles(renderer *lipgloss.Renderer) Styles {
11 		Foreground(Grey)
12 	s.Error = renderer.NewStyle().Foreground(Red)
13 	s.Prompt = renderer.NewStyle().MarginRight(1).SetString(">")
14-	s.FocusedPrompt = s.Prompt.Copy().Foreground(Fuschia)
15+	s.FocusedPrompt = s.Prompt.Foreground(Fuschia)
16 	s.InputPlaceholder = renderer.NewStyle().Foreground(Grey)
17 	s.Note = renderer.NewStyle().Foreground(Green)
18-	s.Delete = s.Error.Copy()
19+	s.Delete = s.Error
20 	s.Label = renderer.NewStyle().Foreground(Fuschia)
21 	s.ListKey = renderer.NewStyle().Foreground(Indigo)
22 	s.InactivePagination = renderer.NewStyle().
23@@ -81,7 +81,7 @@ func DefaultStyles(renderer *lipgloss.Renderer) Styles {
24 		Foreground(Cream).
25 		Background(GreyLight).
26 		Padding(0, 3)
27-	s.FocusedButtonStyle = s.BlurredButtonStyle.Copy().
28+	s.FocusedButtonStyle = s.BlurredButtonStyle.
29 		Background(Fuschia)
30 	s.HelpDivider = renderer.NewStyle().
31 		Foreground(Grey).
M tui/common/views.go
+2, -2
 1@@ -72,9 +72,9 @@ func CancelButtonView(styles Styles, focused bool, defaultButton bool) string {
 2 func styledButton(styles Styles, str string, underlined, focused bool) string {
 3 	var st lipgloss.Style
 4 	if focused {
 5-		st = styles.FocusedButtonStyle.Copy()
 6+		st = styles.FocusedButtonStyle
 7 	} else {
 8-		st = styles.BlurredButtonStyle.Copy()
 9+		st = styles.BlurredButtonStyle
10 	}
11 	if underlined {
12 		st = st.Underline(true)
M tui/pubkeys/keys.go
+1, -1
1@@ -296,7 +296,7 @@ func (m *Model) helpView() string {
2 }
3 
4 func (m *Model) promptView(prompt string) string {
5-	st := m.shared.Styles.Delete.Copy().MarginTop(2).MarginRight(1)
6+	st := m.shared.Styles.Delete.MarginTop(2).MarginRight(1)
7 	return st.Render(prompt) +
8 		m.shared.Styles.Delete.Render("(y/N)")
9 }
M tui/settings/settings.go
+1, -1
1@@ -113,7 +113,7 @@ We will only store usage statistics for 1 year from when the event was created.`
2 		str += banner + "\n\n" + m.shared.Styles.Error.SetString("Analytics is only available to pico+ users.").String()
3 	}
4 
5-	return m.shared.Styles.RoundedBorder.Copy().Width(maxWidth).SetString(str).String()
6+	return m.shared.Styles.RoundedBorder.Width(maxWidth).SetString(str).String()
7 }
8 
9 func (m Model) featuresView() string {
M tui/tokens/tokens.go
+1, -1
1@@ -260,7 +260,7 @@ func (m *Model) helpView() string {
2 }
3 
4 func (m *Model) promptView(prompt string) string {
5-	st := m.shared.Styles.Delete.Copy().MarginTop(2).MarginRight(1)
6+	st := m.shared.Styles.Delete.MarginTop(2).MarginRight(1)
7 	return st.Render(prompt) +
8 		m.shared.Styles.Delete.Render("(y/N)")
9 }
M tui/ui.go
+1, -1
1@@ -170,7 +170,7 @@ func (m *UI) header() string {
2 		SetString(pages.ToTitle(m.activePage))
3 	div := m.shared.
4 		Styles.
5-		HelpDivider.Copy().
6+		HelpDivider.
7 		Foreground(common.Green)
8 	s := fmt.Sprintf("%s%s%s\n\n", logo, div, title)
9 	return s