diff --git a/src/extension.ts b/src/extension.ts index 2882b3b..040155b 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -11,6 +11,7 @@ import { FileUtil } from './common/fileUtil'; const httpExt = require('./bundle/extension'); export function activate(context: vscode.ExtensionContext) { + keepOriginDiff(); activeHTTP(context) autoClearCacheStorage(); const viewOption = { webviewOptions: { retainContextWhenHidden: true, enableFindWidget: true } }; @@ -38,3 +39,14 @@ async function activeHTTP(context: vscode.ExtensionContext) { Output.debug(error) } } + +function keepOriginDiff() { + const config = vscode.workspace.getConfiguration("workbench"); + const configKey = 'editorAssociations' + const editorAssociations = config.get(configKey) + const key = '{git,gitlens}:/**/*.{md,csv}' + if (!editorAssociations[key]) { + editorAssociations[key] = 'default' + config.update(configKey, editorAssociations) + } +} \ No newline at end of file