Skip to content

Commit cd8c3df

Browse files
committed
Improve diff/patch code block parsing to allow detection within plain backtick blocks
1 parent d539a43 commit cd8c3df

2 files changed

Lines changed: 1 addition & 2 deletions

File tree

packages/vscode/src/commands/apply-chat-response-command/utils/clipboard-parser/clipboard-parser.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// packages/vscode/src/commands/apply-chat-response-command/utils/clipboard-parser/clipboard-parser.ts
21
import { cleanup_api_response } from '@/utils/cleanup-api-response'
32
import { extract_path_from_line_of_code } from '@shared/utils/extract-path-from-line-of-code'
43
import { DiffPatch, extract_diff_patches } from './extract-diff-patches'

packages/vscode/src/commands/apply-chat-response-command/utils/clipboard-parser/extract-diff-patches/extract-diff-patches.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ const extract_code_block_patches = (normalized_text: string): DiffPatch[] => {
131131
code_blocks.unshift({ start: j, end: i, type: 'patch' })
132132
i = j // Skip to this position to avoid overlapping blocks
133133
break
134-
} else if (opening_line.startsWith('```')) {
134+
} else if (opening_line.startsWith('```') && opening_line != '```') {
135135
// Found a different code block, stop searching
136136
break
137137
}

0 commit comments

Comments
 (0)