MCPcopy Create free account
hub / github.com/GongShichen/LuminaCode / truncateDisplayLineWithEllipsis

Function truncateDisplayLineWithEllipsis

tools/edit_ui.go:234–246  ·  view source on GitHub ↗
(line string, maxLen int)

Source from the content-addressed store, hash-verified

232}
233
234func truncateDisplayLineWithEllipsis(line string, maxLen int) string {
235 runes := []rune(line)
236 if len(runes) <= maxLen {
237 return line
238 }
239 if maxLen <= 0 {
240 return ""
241 }
242 if maxLen <= 3 {
243 return string(runes[:maxLen])
244 }
245 return string(runes[:maxLen-3]) + "..."
246}
247
248func countDisplayLines(text string) int {
249 count := strings.Count(text, "\n") + 1

Callers 2

RenderEditFileToolUseFunction · 0.85
RenderEditErrorContextFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected