mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-21 09:44:21 +01:00
fix: grep omitting text after a colon (#1053)
This commit is contained in:
@@ -55,12 +55,11 @@ export const GrepTool = Tool.define({
|
|||||||
for (const line of lines) {
|
for (const line of lines) {
|
||||||
if (!line) continue
|
if (!line) continue
|
||||||
|
|
||||||
const parts = line.split(":", 3)
|
const [filePath, lineNumStr, ...lineTextParts] = line.split(":")
|
||||||
if (parts.length < 3) continue
|
if (!filePath || !lineNumStr || lineTextParts.length === 0) continue
|
||||||
|
|
||||||
const filePath = parts[0]
|
const lineNum = parseInt(lineNumStr, 10)
|
||||||
const lineNum = parseInt(parts[1], 10)
|
const lineText = lineTextParts.join(":")
|
||||||
const lineText = parts[2]
|
|
||||||
|
|
||||||
const file = Bun.file(filePath)
|
const file = Bun.file(filePath)
|
||||||
const stats = await file.stat().catch(() => null)
|
const stats = await file.stat().catch(() => null)
|
||||||
|
|||||||
Reference in New Issue
Block a user