Skip to content

Commit 6a08e28

Browse files
committed
stop removing trailing matching lines in FindNewMessage
1 parent 83d04d0 commit 6a08e28

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

lib/screentracker/conversation.go

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -131,23 +131,13 @@ func FindNewMessage(oldScreen, newScreen string) string {
131131
oldLinesMap[line] = true
132132
}
133133
firstNonMatchingLine := len(newLines)
134-
lastNonMatchingLine := 0
135134
for i, line := range newLines {
136135
if !oldLinesMap[line] {
137136
firstNonMatchingLine = i
138137
break
139138
}
140139
}
141-
for i := len(newLines) - 1; i >= 0; i-- {
142-
if !oldLinesMap[newLines[i]] {
143-
lastNonMatchingLine = i
144-
break
145-
}
146-
}
147-
if firstNonMatchingLine > lastNonMatchingLine {
148-
return ""
149-
}
150-
newSectionLines := newLines[firstNonMatchingLine : lastNonMatchingLine+1]
140+
newSectionLines := newLines[firstNonMatchingLine:]
151141

152142
// remove leading and trailing lines which are empty or have only whitespace
153143
startLine := 0

lib/screentracker/testdata/diff/basic/expected.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,9 @@ our options for a rate limit increase."}}) · Retrying in 1 seconds… (attempt
1212

1313
⏺ I'm Claude Code, an AI assistant designed to help with software
1414
engineering tasks. I can help you explore codebases, write code, fix
15-
bugs, and explain concepts.
15+
bugs, and explain concepts.
16+
17+
╭──────────────────────────────────────────────────────────────────────────────╮
18+
│ >  │
19+
╰──────────────────────────────────────────────────────────────────────────────╯
20+
? for shortcuts

0 commit comments

Comments
 (0)