internal GitDiffMargin(IWpfTextView textView, MarginFactory factory) { _textView = textView; _classificationFormatMap = factory.ClassificationFormatMapService.GetClassificationFormatMap(textView); _editorFormatMap = factory.EditorFormatMapService.GetEditorFormatMap(textView); _editorFormatMap.FormatMappingChanged += HandleFormatMappingChanged; _textView.Closed += (sender, e) => _editorFormatMap.FormatMappingChanged -= HandleFormatMappingChanged; UpdateBrushes(); _textView.Options.OptionChanged += HandleOptionChanged; _gitDiffBarControl = new DiffMarginControl(); _viewModel = new DiffMarginViewModel(this, _textView, factory.TextDocumentFactoryService, new GitCommands(factory.ServiceProvider)); _gitDiffBarControl.DataContext = _viewModel; _gitDiffBarControl.Width = MarginWidth; }