MCPcopy Index your code
hub / github.com/codehamr/codehamr / runeBoundaryDown

Function runeBoundaryDown

internal/ctx/ctx.go:100–108  ·  view source on GitHub ↗

runeBoundaryDown walks i left to a rune start so out[:i] never ends mid-sequence. Safe for i == len(out).

(out string, i int)

Source from the content-addressed store, hash-verified

98
99// runeBoundaryDown walks i left to a rune start so out[:i] never ends
100// mid-sequence. Safe for i == len(out).
101func runeBoundaryDown(out string, i int) int {
102 if i >= len(out) {
103 return len(out)
104 }
105 for i > 0 && !utf8.RuneStart(out[i]) {
106 i--
107 }
108 return i
109}
110
111// runeBoundaryUp walks i right to a rune start so out[i:] never starts

Callers 1

TruncateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected