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

Function shouldChip

internal/tui/prompt.go:200–205  ·  view source on GitHub ↗

shouldChip collapses a paste when either its line count or char count clears the threshold: lines catch multi-line pastes, chars catch single-line blobs.

(s string)

Source from the content-addressed store, hash-verified

198// shouldChip collapses a paste when either its line count or char count clears
199// the threshold: lines catch multi-line pastes, chars catch single-line blobs.
200func shouldChip(s string) bool {
201 if countLines(s) >= pasteChipMinLines {
202 return true
203 }
204 return utf8.RuneCountInString(s) >= pasteChipMinChars
205}
206
207// countLines returns a paste's visual line count. Terminals disagree on
208// separators (\n unix, \r old-mac, \r\n Windows); max of the \n and \r counts

Callers 1

UpdateMethod · 0.85

Calls 1

countLinesFunction · 0.85

Tested by

no test coverage detected