Skip to content

Commit d286afb

Browse files
committed
Disable Read tool preview which would otherwise clutter the output window
1 parent 26d7ce5 commit d286afb

1 file changed

Lines changed: 3 additions & 14 deletions

File tree

internal/tools/read.go

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -111,23 +111,12 @@ func (r *ReadTool) Execute(input json.RawMessage, eventsCh chan<- internal.Event
111111
fmt.Fprintf(&content, "%5d\t%s\n", i+1, lines[i])
112112
}
113113

114-
previewCount := min(int64(5), lineCount)
115-
previewLines := make([]string, previewCount)
116-
for i := start; i < start+previewCount; i++ {
117-
previewLines[i-start] = fmt.Sprintf("%5d\t%s", i+1, lines[i])
118-
}
119-
if lineCount > previewCount {
120-
previewLines = append(previewLines, "...")
121-
}
122-
123114
info := fmt.Sprintf("Read %d lines", lineCount)
124115

125116
eventsCh <- internal.Event{
126-
Name: r.Name(),
127-
Args: []string{cleanPath},
128-
Message: info,
129-
Preview: previewLines,
130-
PreviewType: internal.PreviewCode,
117+
Name: r.Name(),
118+
Args: []string{cleanPath},
119+
Message: info,
131120
}
132121

133122
return ToolResult{

0 commit comments

Comments
 (0)