Skip to content

Feature 29241: Add option to disable git indicators in gutter #29700

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 11, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { ITextModelService } from 'vs/editor/common/services/resolverService';
import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService';
import { IModelService } from 'vs/editor/common/services/modelService';
import { IEditorWorkerService } from 'vs/editor/common/services/editorWorkerService';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import URI from 'vs/base/common/uri';
import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService';
import { ISCMService } from 'vs/workbench/services/scm/common/scm';
Expand Down Expand Up @@ -214,7 +215,8 @@ export class DirtyDiffDecorator implements ext.IWorkbenchContribution {
@IWorkbenchEditorService private editorService: IWorkbenchEditorService,
@IEditorGroupService editorGroupService: IEditorGroupService,
@IWorkspaceContextService private contextService: IWorkspaceContextService,
@IInstantiationService private instantiationService: IInstantiationService
@IInstantiationService private instantiationService: IInstantiationService,
@IConfigurationService private configurationService: IConfigurationService
) {
this.toDispose.push(editorGroupService.onEditorsChanged(() => this.onEditorsChanged()));
}
Expand All @@ -228,6 +230,11 @@ export class DirtyDiffDecorator implements ext.IWorkbenchContribution {
// or not. Needs context from the editor, to know whether it is a diff editor, in place editor
// etc.

const enableDecorators = this.configurationService.lookup('editor.enableDecorators').value;
if (!enableDecorators) {
return;
}

const models = this.editorService.getVisibleEditors()

// map to the editor controls
Expand Down
15 changes: 15 additions & 0 deletions src/vs/workbench/parts/scm/electron-browser/scm.contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { ISCMService } from 'vs/workbench/services/scm/common/scm';
import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet';
import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService';
import { StatusUpdater } from './scmActivity';
import { IConfigurationRegistry, Extensions as ConfigurationExtensions } from 'vs/platform/configuration/common/configurationRegistry';

class OpenSCMViewletAction extends ToggleViewletAction {

Expand Down Expand Up @@ -82,6 +83,20 @@ const viewletDescriptor = new ViewletDescriptor(
36
);

// Configuration
Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Configuration).registerConfiguration({
id: 'editor',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be scm

order: 5,
type: 'object',
properties: {
'editor.enableDecorators': {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The property should be scm.enableDiffDecorations.

'type': 'boolean',
'default': true,
'description': localize('enableDecorators', "Enables or disables color decorators when changes happen in the editor.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enables or disables diff decorations in modified files.

},
}
});

Registry.as<ViewletRegistry>(ViewletExtensions.Viewlets)
.registerViewlet(viewletDescriptor);

Expand Down