diff --git a/src/algo/algo.go b/src/algo/algo.go index ba09dc5..1d021ed 100644 --- a/src/algo/algo.go +++ b/src/algo/algo.go @@ -221,9 +221,9 @@ func charClassOfAscii(char rune) charClass { return charUpper } else if char >= '0' && char <= '9' { return charNumber - } else if strings.IndexRune(whiteChars, char) >= 0 { + } else if strings.ContainsRune(whiteChars, char) { return charWhite - } else if strings.IndexRune(delimiterChars, char) >= 0 { + } else if strings.ContainsRune(delimiterChars, char) { return charDelimiter } return charNonWord @@ -240,7 +240,7 @@ func charClassOfNonAscii(char rune) charClass { return charLetter } else if unicode.IsSpace(char) { return charWhite - } else if strings.IndexRune(delimiterChars, char) >= 0 { + } else if strings.ContainsRune(delimiterChars, char) { return charDelimiter } return charNonWord diff --git a/src/terminal.go b/src/terminal.go index 94f4c6c..2889ed5 100644 --- a/src/terminal.go +++ b/src/terminal.go @@ -763,7 +763,7 @@ func (t *Terminal) ansiLabelPrinter(str string, color *tui.ColorPair, fill bool) runes := []rune(text) // Simpler printer for strings without ANSI colors or tab characters - if colors == nil && strings.IndexRune(str, '\t') < 0 { + if colors == nil && !strings.ContainsRune(str, '\t') { length := util.StringWidth(str) if length == 0 { return nil, 0