diff options
Diffstat (limited to 'extension/src/diffs.ts')
-rw-r--r-- | extension/src/diffs.ts | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/extension/src/diffs.ts b/extension/src/diffs.ts index 4c077a25..426415fc 100644 --- a/extension/src/diffs.ts +++ b/extension/src/diffs.ts @@ -3,7 +3,7 @@ import * as path from "path"; import * as fs from "fs"; import * as vscode from "vscode"; import { extensionContext, ideProtocolClient } from "./activation/activate"; -import { getMetaKeyLabel } from "./util/util"; +import { getMetaKeyLabel, getPlatform } from "./util/util"; import { devDataPath } from "./activation/environmentSetup"; import { uriFromFilePath } from "./util/vscode"; @@ -194,10 +194,15 @@ class DiffManager { this.diffs.set(newFilepath, diffInfo); } - vscode.commands.executeCommand( - "workbench.action.files.revert", - uriFromFilePath(newFilepath) - ); + if (getPlatform() === "windows") { + // Just a matter of how it renders + // Lags on windows without this + // Flashes too much on mac with it + vscode.commands.executeCommand( + "workbench.action.files.revert", + uriFromFilePath(newFilepath) + ); + } return newFilepath; } @@ -271,6 +276,8 @@ class DiffManager { }); await recordAcceptReject(true, diffInfo); + + ideProtocolClient.sendAcceptRejectDiff(true, diffInfo.step_index); } async rejectDiff(newFilepath?: string) { @@ -302,6 +309,8 @@ class DiffManager { }); await recordAcceptReject(false, diffInfo); + + ideProtocolClient.sendAcceptRejectDiff(false, diffInfo.step_index); } } @@ -339,10 +348,8 @@ async function recordAcceptReject(accepted: boolean, diffInfo: DiffInfo) { export async function acceptDiffCommand(newFilepath?: string) { await diffManager.acceptDiff(newFilepath); - ideProtocolClient.sendAcceptRejectDiff(true); } export async function rejectDiffCommand(newFilepath?: string) { await diffManager.rejectDiff(newFilepath); - ideProtocolClient.sendAcceptRejectDiff(false); } |