Skip to content

Commit

Permalink
Fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
noborus committed Jan 20, 2025
1 parent 907baf3 commit d1036f0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions oviewer/convert_es.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ type sgrParams struct {
// convert parses an escape sequence and changes state.
// Returns true if it is an escape sequence and a non-printing character.
func (es *escapeSequence) convert(st *parseState) bool {
return es.paraseEscapeSequence(st)
return es.parseEscapeSequence(st)
}

// parseEscapeSequence parses the escape sequence.
// convert parses an escape sequence and changes state.
func (es *escapeSequence) paraseEscapeSequence(st *parseState) bool {
func (es *escapeSequence) parseEscapeSequence(st *parseState) bool {
mainc := st.mainc
switch es.state {
case ansiEscape:
Expand Down Expand Up @@ -293,7 +293,7 @@ func toSGRCode(paramList []string, index int) (sgrParams, error) {
colonLists := strings.Split(str, ":")
code, err := esNumber(colonLists[0])
if err != nil {
return sgrParams{}, ErrNotSuuport
return sgrParams{}, ErrNotSupport
}
sgr.code = code

Expand Down Expand Up @@ -321,7 +321,7 @@ func esNumber(str string) (int, error) {
return 0, nil
}
if containsNonDigit(str) {
return 0, ErrNotSuuport
return 0, ErrNotSupport
}
num, err := strconv.Atoi(str)
if err != nil {
Expand All @@ -343,11 +343,11 @@ func containsNonDigit(str string) bool {
// parseSGRColor parses 256 color or RGB color.
// Returns the color name and increase in the index (the colon does not increase).
func parseSGRColor(sgr sgrParams) (string, int, error) {
color, inc, error := convertSGRColor(sgr)
color, inc, err := convertSGRColor(sgr)
if sgr.colonF { // In the case of colon, index does not increase.
inc = 0
}
return color, inc, error
return color, inc, err
}

// convertSGRColor converts the SGR color to a string that can be used to specify the color of tcell.
Expand Down
6 changes: 3 additions & 3 deletions oviewer/convert_es_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ func Test_parseSGR(t *testing.T) {
wantErr: false,
},
{
name: "test-forground2",
name: "test-foreground2",
args: args{
params: "038;05;02",
},
Expand All @@ -340,7 +340,7 @@ func Test_parseSGR(t *testing.T) {
},
},
{
name: "test-forground216",
name: "test-foreground216",
args: args{
params: "38;5;216",
},
Expand All @@ -350,7 +350,7 @@ func Test_parseSGR(t *testing.T) {
wantErr: false,
},
{
name: "test-forground216_Underline",
name: "test-foreground216_Underline",
args: args{
params: "38;5;216;4",
},
Expand Down
4 changes: 2 additions & 2 deletions oviewer/oviewer.go
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,8 @@ var (
ErrNoColumnSelected = errors.New("no column selected")
// ErrInvalidSGR indicates that the SGR is invalid.
ErrInvalidSGR = errors.New("invalid SGR")
// ErrNotSuuport indicates that it is not supported.
ErrNotSuuport = errors.New("not support")
// ErrNotSupport indicates that it is not supported.
ErrNotSupport = errors.New("not support")
// ErrInvalidDocumentNum indicates that the document number is invalid.
ErrInvalidDocumentNum = errors.New("invalid document number")
)
Expand Down

0 comments on commit d1036f0

Please sign in to comment.