Skip to content

Commit

Permalink
remove duplicated code
Browse files Browse the repository at this point in the history
  • Loading branch information
jedib0t committed Dec 13, 2024
1 parent 939a7e1 commit 917d480
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions text/string.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,18 +207,7 @@ func RuneWidth(r rune) int {
//
// deprecated: use StringWidthWithoutEscSequences instead
func RuneWidthWithoutEscSequences(str string) int {
count, esp := 0, escSeqParser{}
for _, c := range str {
if esp.InSequence() {
esp.Consume(c)
continue
}
esp.Consume(c)
if !esp.InSequence() {
count += RuneWidth(c)
}
}
return count
return StringWidthWithoutEscSequences(str)
}

// Snip returns the given string with a fixed length. For ex.:
Expand Down

0 comments on commit 917d480

Please sign in to comment.