Skip to content

Commit b51e9ef

Browse files
committed
Fix yc icon
1 parent 6bb9f24 commit b51e9ef

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ _WIP_
77
- Add support for xdg-open on FreeBSD, OpenBSD, and NetBSD
88
- Bump Go to 1.25
99
- Set timeout for fetching submissions to 10 seconds
10+
- Fixed a bug where the ycombinator nerdfont showing the wrong icon
1011

1112
## 3.8
1213

constants/nerdfonts/nerdfonts.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const (
99
Document = ""
1010
Audio = ""
1111
Video = ""
12+
YCombinator = ""
1213
LeftSeparator = ""
1314
RightSeparator = ""
1415
)

syntax/syntax.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
package syntax
22

33
import (
4-
"github.com/logrusorgru/aurora/v3"
54
"regexp"
65
"strings"
76

7+
"github.com/logrusorgru/aurora/v3"
8+
89
"clx/constants/nerdfonts"
910

1011
"clx/constants/unicode"
12+
1113
"github.com/charmbracelet/lipgloss"
1214
)
1315

@@ -36,19 +38,19 @@ func HighlightYCStartupsInHeadlines(comment string, highlightType int, enableNer
3638
if enableNerdFonts {
3739
expression = regexp.MustCompile(`\((YC ([SW]\d{2}))\)`)
3840

39-
highlightedStartup := reset + getYCBarNerdFonts(``+unicode.NoBreakSpace+`$2`, highlightType, enableNerdFonts) +
41+
highlightedStartup := reset + getYCBarNerdFonts(nerdfonts.YCombinator+unicode.NoBreakSpace+`$2`, highlightType, enableNerdFonts) +
4042
getHighlight(highlightType)
4143
return expression.ReplaceAllString(comment, highlightedStartup)
4244
}
4345

4446
expression = regexp.MustCompile(`\((YC [SW]\d{2})\)`)
45-
highlightedStartup := reset + getYCBar(`$1`, highlightType, enableNerdFonts) +
47+
highlightedStartup := reset + getYCBar(`$1`, highlightType) +
4648
getHighlight(highlightType)
4749

4850
return expression.ReplaceAllString(comment, highlightedStartup)
4951
}
5052

51-
func getYCBar(text string, highlightType int, enableNerdFonts bool) string {
53+
func getYCBar(text string, highlightType int) string {
5254
switch highlightType {
5355
case Selected:
5456
return lipgloss.NewStyle().Foreground(lipgloss.Color("3")).Reverse(true).Render(text)
@@ -59,7 +61,6 @@ func getYCBar(text string, highlightType int, enableNerdFonts bool) string {
5961
default:
6062
return lipgloss.NewStyle().Foreground(lipgloss.Color("3")).Render(text)
6163
}
62-
6364
}
6465

6566
func getYCBarNerdFonts(text string, highlightType int, enableNerdFonts bool) string {

0 commit comments

Comments
 (0)