Skip to content

Commit 497eacb

Browse files
committed
Disable stop check when line limit <= 0
1 parent 00305e5 commit 497eacb

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

Core/Sources/CodeCompletionService/StreamLineLimiter.swift

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,15 @@ final class StreamLineLimiter {
3030
currentLine = lastLine ?? ""
3131
}
3232

33-
let stopResult = strategy.shouldStop(
34-
existedLines: existedLines,
35-
currentLine: currentLine,
36-
proposedLineLimit: lineLimit
37-
)
33+
let stopResult = if lineLimit <= 0 {
34+
StreamStopStrategyResult.continue
35+
} else {
36+
strategy.shouldStop(
37+
existedLines: existedLines,
38+
currentLine: currentLine,
39+
proposedLineLimit: lineLimit
40+
)
41+
}
3842

3943
switch stopResult {
4044
case .continue:

0 commit comments

Comments
 (0)