MCPcopy
hub / github.com/micro-editor/micro / DecodeCharacter

Function DecodeCharacter

internal/util/unicode.go:31–46  ·  view source on GitHub ↗

DecodeCharacter returns the next character from an array of bytes A character is a rune along with any accompanying combining runes

(b []byte)

Source from the content-addressed store, hash-verified

29// DecodeCharacter returns the next character from an array of bytes
30// A character is a rune along with any accompanying combining runes
31func DecodeCharacter(b []byte) (rune, []rune, int) {
32 r, size := utf8.DecodeRune(b)
33 b = b[size:]
34 c, s := utf8.DecodeRune(b)
35
36 var combc []rune
37 for isMark(c) {
38 combc = append(combc, c)
39 size += s
40
41 b = b[s:]
42 c, s = utf8.DecodeRune(b)
43 }
44
45 return r, combc, size
46}
47
48// DecodeCharacterInString returns the next character from a string
49// A character is a rune along with any accompanying combining runes

Callers 15

DisplayMethod · 0.92
getStartInfoMethod · 0.92
displayBufferMethod · 0.92
DisplayMethod · 0.92
getVLocFromLocMethod · 0.92
getLocFromVLocMethod · 0.92
displayBufferMethod · 0.92
runeToByteIndexFunction · 0.92
RuneAtMethod · 0.92
RuneUnderMethod · 0.92
SliceEndFunction · 0.70
SliceStartFunction · 0.70

Calls 1

isMarkFunction · 0.70

Tested by

no test coverage detected