MCPcopy Index your code
hub / github.com/micro-editor/micro / DecodeCharacterInString

Function DecodeCharacterInString

internal/util/unicode.go:50–65  ·  view source on GitHub ↗

DecodeCharacterInString returns the next character from a string A character is a rune along with any accompanying combining runes

(str string)

Source from the content-addressed store, hash-verified

48// DecodeCharacterInString returns the next character from a string
49// A character is a rune along with any accompanying combining runes
50func DecodeCharacterInString(str string) (rune, []rune, int) {
51 r, size := utf8.DecodeRuneInString(str)
52 str = str[size:]
53 c, s := utf8.DecodeRuneInString(str)
54
55 var combc []rune
56 for isMark(c) {
57 combc = append(combc, c)
58 size += s
59
60 str = str[s:]
61 c, s = utf8.DecodeRuneInString(str)
62 }
63
64 return r, combc, size
65}
66
67// CharacterCount returns the number of characters in a byte array
68// Similar to utf8.RuneCount but for unicode characters

Callers 7

displayStatusLineMethod · 0.92
drawNodeMethod · 0.92
LuaRuneAtFunction · 0.70
LuaGetLeadingWhitespaceFunction · 0.70
LuaIsWordCharFunction · 0.70
SliceEndStrFunction · 0.70
SliceStartStrFunction · 0.70

Calls 1

isMarkFunction · 0.70

Tested by

no test coverage detected