Skip to content

Commit

Permalink
fix: accept and reject error
Browse files Browse the repository at this point in the history
(cherry picked from commit 02c72fa)
  • Loading branch information
lee88688 committed Nov 23, 2024
1 parent 2cf933e commit c426196
Showing 1 changed file with 25 additions and 14 deletions.
39 changes: 25 additions & 14 deletions src/diffView/InlineDiff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,22 +94,33 @@ export class InlineDiffViewManager
this._onDidChangeCodeLenses,

// accept command
vscode.commands.registerCommand('aider-composer.AcceptChange', () => {
const uri = vscode.window.activeTextEditor?.document.uri;
if (!uri) {
return;
}
this.acceptChange(uri.toString());
}),
vscode.commands.registerCommand(
'aider-composer.AcceptChange',
(uriStr: string, i: number) => {
if (typeof uriStr !== 'string') {
const uri = vscode.window.activeTextEditor?.document.uri;
if (!uri) {
return;
}
uriStr = uri.toString();
}
this.acceptChange(uriStr, i);
},
),

// reject command
vscode.commands.registerCommand('aider-composer.RejectChange', () => {
const uri = vscode.window.activeTextEditor?.document.uri;
if (!uri) {
return;
}
this.rejectChange(uri.toString());
}),
vscode.commands.registerCommand(
'aider-composer.RejectChange',
(uriStr: string, i: number) => {
if (typeof uriStr !== 'string') {
const uri = vscode.window.activeTextEditor?.document.uri;
if (!uri) {
return;
}
}
this.rejectChange(uriStr, i);
},
),

// accept all command
vscode.commands.registerCommand(
Expand Down

0 comments on commit c426196

Please sign in to comment.