Skip to content

Commit b7d6f78

Browse files
committed
Merge branch 'main' of https://github.com/RooVetGit/Roo-Code into bug/1631/v001
2 parents d2b4958 + 0759de2 commit b7d6f78

File tree

5 files changed

+81
-107
lines changed

5 files changed

+81
-107
lines changed

package-lock.json

Lines changed: 58 additions & 104 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/core/diff/strategies/__tests__/multi-search-replace.test.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1486,6 +1486,23 @@ function five() {
14861486
}`)
14871487
}
14881488
})
1489+
1490+
it("should delete a line when search block has line number prefix and replace is empty", async () => {
1491+
const originalContent = "line 1\nline to delete\nline 3"
1492+
const diffContent = `
1493+
<<<<<<< SEARCH
1494+
:start_line:2
1495+
:end_line:2
1496+
-------
1497+
2 | line to delete
1498+
=======
1499+
>>>>>>> REPLACE`
1500+
const result = await strategy.applyDiff(originalContent, diffContent)
1501+
expect(result.success).toBe(true)
1502+
if (result.success) {
1503+
expect(result.content).toBe("line 1\nline 3")
1504+
}
1505+
})
14891506
})
14901507

14911508
describe("insertion", () => {

src/core/diff/strategies/multi-search-replace.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,10 @@ Only use a single line of '=======' between search and replacement content, beca
301301
replaceContent = this.unescapeMarkers(replaceContent)
302302

303303
// Strip line numbers from search and replace content if every line starts with a line number
304-
if (everyLineHasLineNumbers(searchContent) && everyLineHasLineNumbers(replaceContent)) {
304+
if (
305+
(everyLineHasLineNumbers(searchContent) && everyLineHasLineNumbers(replaceContent)) ||
306+
(everyLineHasLineNumbers(searchContent) && replaceContent.trim() === "")
307+
) {
305308
searchContent = stripLineNumbers(searchContent)
306309
replaceContent = stripLineNumbers(replaceContent)
307310
}

webview-ui/src/components/history/HistoryView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ const HistoryView = ({ onDone }: HistoryViewProps) => {
8585
: `${t("history:enterSelectionMode")}`
8686
}>
8787
<span
88-
className={`codicon ${isSelectionMode ? "codicon-check-all" : "codicon-checklist"}`}
88+
className={`codicon ${isSelectionMode ? "codicon-check-all" : "codicon-checklist"} mr-1`}
8989
/>
9090
{isSelectionMode ? t("history:exitSelection") : t("history:selectionMode")}
9191
</VSCodeButton>

webview-ui/src/components/ui/select-dropdown.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export const SelectDropdown = React.forwardRef<React.ElementRef<typeof DropdownM
106106
onEscapeKeyDown={() => setOpen(false)}
107107
onInteractOutside={() => setOpen(false)}
108108
container={portalContainer}
109-
className={contentClassName}>
109+
className={cn("overflow-y-auto max-h-[80vh]", contentClassName)}>
110110
{options.map((option, index) => {
111111
if (option.type === DropdownOptionType.SEPARATOR) {
112112
return <DropdownMenuSeparator key={`sep-${index}`} />

0 commit comments

Comments
 (0)