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

Method chipAtBoundary

internal/tui/prompt.go:165–176  ·  view source on GitHub ↗

chipAtBoundary returns the chip whose start (atStart=true) or end (atStart=false) coincides with cur, the check Backspace/Delete/Left/Right share.

(cur int, atStart bool)

Source from the content-addressed store, hash-verified

163// chipAtBoundary returns the chip whose start (atStart=true) or end
164// (atStart=false) coincides with cur, the check Backspace/Delete/Left/Right share.
165func (p promptInput) chipAtBoundary(cur int, atStart bool) (chipSpan, bool) {
166 for _, chip := range p.spans {
167 boundary := chip.end
168 if atStart {
169 boundary = chip.start
170 }
171 if cur == boundary {
172 return chip, true
173 }
174 }
175 return chipSpan{}, false
176}
177
178// looksLikePaste recognises paste-like key events. Primary signal: the
179// bracketed-paste Paste flag (terminal wraps content in \x1b[200~...\x1b[201~).

Callers 1

handleChipKeyMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected