MCPcopy Index your code
hub / github.com/claude-code-best/claude-code / tryPush

Function tryPush

src/utils/readFileInRange.ts:162–174  ·  view source on GitHub ↗
(line: string)

Source from the content-addressed store, hash-verified

160 let truncatedByBytes = false
161
162 function tryPush(line: string): boolean {
163 if (truncateAtBytes !== undefined) {
164 const sep = selectedLines.length > 0 ? 1 : 0
165 const nextBytes = selectedBytes + sep + Buffer.byteLength(line)
166 if (nextBytes > truncateAtBytes) {
167 truncatedByBytes = true
168 return false
169 }
170 selectedBytes = nextBytes
171 }
172 selectedLines.push(line)
173 return true
174 }
175
176 while ((newlinePos = text.indexOf('\n', startPos)) !== -1) {
177 if (lineIndex >= offset && lineIndex < endLine && !truncatedByBytes) {

Callers 1

readFileInRangeFastFunction · 0.85

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected