MCPcopy Create free account
hub / github.com/codehamr/codehamr / runeBoundaryUp

Function runeBoundaryUp

internal/ctx/ctx.go:112–120  ·  view source on GitHub ↗

runeBoundaryUp walks i right to a rune start so out[i:] never starts mid-sequence. Safe for i <= 0.

(out string, i int)

Source from the content-addressed store, hash-verified

110// mid-sequence. Safe for i == len(out).
111func runeBoundaryDown(out string, i int) int {
112 if i >= len(out) {
113 return len(out)
114 }
115 for i > 0 && !utf8.RuneStart(out[i]) {
116 i--
117 }
118 return i
119}
120
121// runeBoundaryUp walks i right to a rune start so out[i:] never starts
122// mid-sequence. Safe for i <= 0.
123func runeBoundaryUp(out string, i int) int {

Callers 1

TruncateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected