diff options
Diffstat (limited to 'extension')
-rw-r--r-- | extension/package-lock.json | 4 | ||||
-rw-r--r-- | extension/package.json | 6 | ||||
-rw-r--r-- | extension/react-app/src/components/ComboBox.tsx | 2 | ||||
-rw-r--r-- | extension/src/diffs.ts | 22 |
4 files changed, 24 insertions, 10 deletions
diff --git a/extension/package-lock.json b/extension/package-lock.json index 6e527583..b322acb7 100644 --- a/extension/package-lock.json +++ b/extension/package-lock.json @@ -1,12 +1,12 @@ { "name": "continue", - "version": "0.0.112", + "version": "0.0.113", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "continue", - "version": "0.0.112", + "version": "0.0.113", "license": "Apache-2.0", "dependencies": { "@electron/rebuild": "^3.2.10", diff --git a/extension/package.json b/extension/package.json index 413e5b89..09703da4 100644 --- a/extension/package.json +++ b/extension/package.json @@ -14,7 +14,7 @@ "displayName": "Continue", "pricing": "Free", "description": "The open-source coding autopilot", - "version": "0.0.112", + "version": "0.0.113", "publisher": "Continue", "engines": { "vscode": "^1.67.0" @@ -130,12 +130,12 @@ "key": "shift+ctrl+enter" }, { - "command": "continue.acceptAllSuggestions", + "command": "continue.acceptDiff", "mac": "shift+cmd+enter", "key": "shift+ctrl+enter" }, { - "command": "continue.rejectAllSuggestions", + "command": "continue.rejectDiff", "mac": "shift+cmd+backspace", "key": "shift+ctrl+backspace" } diff --git a/extension/react-app/src/components/ComboBox.tsx b/extension/react-app/src/components/ComboBox.tsx index 61c9ab1e..81b148b9 100644 --- a/extension/react-app/src/components/ComboBox.tsx +++ b/extension/react-app/src/components/ComboBox.tsx @@ -55,7 +55,7 @@ const MainTextInput = styled.textarea` } `; -const UlMaxHeight = 200; +const UlMaxHeight = 400; const Ul = styled.ul<{ hidden: boolean; showAbove: boolean; diff --git a/extension/src/diffs.ts b/extension/src/diffs.ts index 178b1a9d..1b8888e8 100644 --- a/extension/src/diffs.ts +++ b/extension/src/diffs.ts @@ -92,7 +92,14 @@ class DiffManager { fs.unlinkSync(diffInfo.newFilepath); } - acceptDiff(newFilepath: string) { + acceptDiff(newFilepath?: string) { + // If no newFilepath is provided and there is only one in the dictionary, use that + if (!newFilepath && this.diffs.size === 1) { + newFilepath = Array.from(this.diffs.keys())[0]; + } + if (!newFilepath) { + return; + } // Get the diff info, copy new file to original, then delete from record and close the corresponding editor const diffInfo = this.diffs.get(newFilepath); if (!diffInfo) { @@ -105,7 +112,14 @@ class DiffManager { this.cleanUpDiff(diffInfo); } - rejectDiff(newFilepath: string) { + rejectDiff(newFilepath?: string) { + // If no newFilepath is provided and there is only one in the dictionary, use that + if (!newFilepath && this.diffs.size === 1) { + newFilepath = Array.from(this.diffs.keys())[0]; + } + if (!newFilepath) { + return; + } const diffInfo = this.diffs.get(newFilepath); if (!diffInfo) { return; @@ -117,10 +131,10 @@ class DiffManager { export const diffManager = new DiffManager(); -export async function acceptDiffCommand(newFilepath: string) { +export async function acceptDiffCommand(newFilepath?: string) { diffManager.acceptDiff(newFilepath); } -export async function rejectDiffCommand(newFilepath: string) { +export async function rejectDiffCommand(newFilepath?: string) { diffManager.rejectDiff(newFilepath); } |