Skip to content

Commit

Permalink
fix(term): ansi typo
Browse files Browse the repository at this point in the history
  • Loading branch information
aymanbagabas committed Feb 8, 2024
1 parent 6980ef1 commit fdbce38
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion exp/term/ansi/doc.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// This package defines common ANSI escape sequences.
// This package defines common ANSI escape sequences based on the ECMA-48
// specs.
//
// All sequences use 7-bit C1 control codes, which are supported by most
// terminal emulators. Osc sequences are terminated by a BEL for wider
Expand Down
2 changes: 1 addition & 1 deletion exp/term/ansi/style/style.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func Sequence(attrs ...Attribute) string {
}

// Foreground returns the SGR attribute for the given foreground color.
func ForegrondColor(c Color) Attribute {
func ForegroundColor(c Color) Attribute {
switch c := c.(type) {
case BasicColor:
// 3-bit or 4-bit ANSI foreground
Expand Down
4 changes: 2 additions & 2 deletions exp/term/ansi/style/style_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ func TestSequence(t *testing.T) {
if style.Sequence(
style.Bold,
style.Underline,
style.ForegrondColor(style.ExtendedColor(255)),
style.ForegroundColor(style.ExtendedColor(255)),
) != "\x1b[1;4;38;5;255m" {
t.Errorf("Unexpected sequence: %s", style.Sequence(style.Bold, style.Underline, style.ForegrondColor(style.ExtendedColor(255))))
t.Errorf("Unexpected sequence: %s", style.Sequence(style.Bold, style.Underline, style.ForegroundColor(style.ExtendedColor(255))))
}
}

0 comments on commit fdbce38

Please sign in to comment.