✨ cmd/ctrl+z to reject quick edit diff

This commit is contained in:
Nate Sesti 2024-02-09 22:40:52 -08:00
parent e0fade5c6b
commit e8a20e1590
3 changed files with 20 additions and 16 deletions

View file

@ -198,6 +198,12 @@
"mac": "shift+cmd+backspace",
"key": "shift+ctrl+backspace"
},
{
"command": "continue.rejectDiff",
"mac": "cmd+z",
"key": "ctrl+z",
"when": "continue.streamingDiff"
},
{
"command": "continue.quickEdit",
"mac": "cmd+shift+l",

View file

@ -175,6 +175,11 @@ export class VerticalPerLineDiffHandler {
}
clear(accept: boolean) {
vscode.commands.executeCommand(
"setContext",
"continue.streamingDiff",
false
);
const rangesToDelete = accept
? this.redDecorationManager.getRanges()
: this.greenDecorationManager.getRanges();

View file

@ -131,22 +131,15 @@ export async function streamEdit(input: string) {
}
input = `Original request: ${existingHandler.input}\nUpdated request: ${input}`;
}
try {
await diffHandler.run(
streamDiffLines(
rangeContent,
llm,
input,
getMarkdownLanguageTagForFile(filepath)
)
);
} finally {
vscode.commands.executeCommand(
"setContext",
"continue.streamingDiff",
false
);
}
await diffHandler.run(
streamDiffLines(
rangeContent,
llm,
input,
getMarkdownLanguageTagForFile(filepath)
)
);
}
export interface VerticalDiffCodeLens {