@@ -12,6 +12,7 @@ import (
1212 tea "charm.land/bubbletea/v2"
1313 "github.com/rs/zerolog/log"
1414 "github.com/xonecas/symb/internal/filesearch"
15+ "github.com/xonecas/symb/internal/hashline"
1516 "github.com/xonecas/symb/internal/provider"
1617 "github.com/xonecas/symb/internal/tui/modal"
1718 )
@@ -68,12 +69,6 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
6869 m.mcpTools = msg.Tools
6970 return m, nil
7071
71- case ShellOutputMsg:
72- m.ensureStreaming()
73- m.streamingContent += msg.Content
74- m.streamDirty = true
75- return m, nil
76-
7772 case undoMsg:
7873 return m.handleUndo(), nil
7974
@@ -467,8 +462,7 @@ func (m *Model) clearStreaming() {
467462 }
468463
469464 // applyToolResultMsg appends tool result display entries.
470-// It also clears any active streaming state (e.g. from ShellOutputMsg)
471-// so the next applyAssistantMsg doesn't truncate the tool result entries.
465+// It also clears any active streaming state so the next applyAssistantMsg doesn't truncate the tool result entries.
472466 func (m *Model) applyToolResultMsg(msg llmToolResultMsg) {
473467 m.clearStreaming()
474468
@@ -485,6 +479,9 @@ func (m *Model) applyToolResultMsg(msg llmToolResultMsg) {
485479 } else if tc, ok := m.pendingToolCalls[msg.toolCallID]; ok && tc.Name == "Edit" {
486480 startLine = toolCallEditLine(tc.Arguments)
487481 }
482+ if startLine == 0 && filePath != "" {
483+ startLine = toolResultHashlineStart(msg.content, filePath)
484+ }
488485
489486 body, diagLines := extractDiagLines(msg.content)
490487 if idx := strings.Index(body, "\n"); idx >= 0 {
@@ -495,7 +492,7 @@ func (m *Model) applyToolResultMsg(msg llmToolResultMsg) {
495492 entry := convEntry{display: arrow + m.styleToolResultLine(body), kind: entryToolResult, filePath: filePath, full: msg.content, line: startLine}
496493 wasBottom := m.appendConv(entry)
497494 for _, dl := range diagLines {
498- m.appendConv(convEntry{display: m.styleToolResultLine(dl), kind: entryToolResult, filePath: filePath, full: msg.content, line: startLine})
495+ m.appendConv(convEntry{display: m.styleToolResultLine(dl), kind: entryToolDiag, full: msg.content})
499496 }
500497 if wasBottom {
501498 m.scrollOffset = 0
@@ -517,8 +514,6 @@ func extractDiagLines(content string) (body string, diags []string) {
517514 return content[:idx], diags
518515 }
519516
520-
521-
522517 // styleToolResultLine applies semantic styling to a tool result line.
523518 // Diagnostic lines (ERROR/WARNING) get colored; everything else is dim.
524519 func (m *Model) styleToolResultLine(line string) string {
@@ -566,6 +561,38 @@ func toolCallEditLine(args json.RawMessage) int {
566561 return 0
567562 }
568563
564+// toolResultHashlineStart scans a tool result body for the first hashline and
565+// returns its line number if it matches the provided file path.
566+func toolResultHashlineStart(content, filePath string) int {
567+ prefix := "Read " + filePath + " "
568+ if !strings.HasPrefix(content, prefix) {
569+ prefix = "Edited " + filePath + " "
570+ if !strings.HasPrefix(content, prefix) {
571+ prefix = "Created " + filePath + " "
572+ if !strings.HasPrefix(content, prefix) {
573+ return 0
574+ }
575+ }
576+ }
577+ lines := strings.Split(content, "\n")
578+ for _, line := range lines {
579+ if line == "" {
580+ continue
581+ }
582+ idx := strings.IndexByte(line, '|')
583+ if idx <= 0 {
584+ continue
585+ }
586+ anchor := line[:idx]
587+ parsed, err := hashline.ParseAnchor(anchor)
588+ if err != nil {
589+ continue
590+ }
591+ return parsed.Num
592+ }
593+ return 0
594+}
595+
569596 // formatToolCall renders a tool call as Name(key="val", key2="val2").
570597 // Long values are truncated. Falls back to Name(...) on parse errors.
571598 func formatToolCall(tc provider.ToolCall) string {