protected override void OnSelected() { info.Start(); BlameWidget widget = Control.GetNativeWidget <BlameWidget> (); widget.Reset(); var sourceEditor = info.Document.GetContent <MonoDevelop.SourceEditor.SourceEditorView> (); if (sourceEditor != null) { widget.Editor.Caret.Location = sourceEditor.TextEditor.Caret.Location; widget.Editor.VAdjustment.Value = sourceEditor.TextEditor.VAdjustment.Value; } }
protected override void OnSelected() { info.Start(); BlameWidget widget = Control.GetNativeWidget <BlameWidget> (); widget.Reset(); var buffer = info.Document.GetContent <MonoDevelop.Ide.Editor.TextEditor> (); if (buffer != null) { var loc = buffer.CaretLocation; int line = loc.Line < 1 ? 1 : loc.Line; int column = loc.Column < 1 ? 1 : loc.Column; widget.Editor.SetCaretTo(line, column, highlight: false, centerCaret: false); } }
protected override void OnSelected() { info.Start(); BlameWidget blameWidget = Control.GetNativeWidget <BlameWidget> (); blameWidget.Reset(); var buffer = info.Document.GetContent <MonoDevelop.Ide.Editor.TextEditor> (); if (buffer != null) { if (!(buffer.TextView is MonoTextEditor)) { //compatibility for other not MonoTextEditor editors var loc = buffer.CaretLocation; int line = loc.Line < 1 ? 1 : loc.Line; int column = loc.Column < 1 ? 1 : loc.Column; blameWidget.Editor.SetCaretTo(line, column, highlight: false, centerCaret: false); } } }
protected override void OnFocused() { info.Start(); widget.Reset(); var textView = info.Controller.GetContent <ITextView> (); if (textView != null) { var(line, column) = textView.Caret.Position.BufferPosition.GetLineAndColumn1Based(); widget.Editor.SetCaretTo(line, column, highlight: false, centerCaret: false); } if (widget.Allocation.Height == 1 && widget.Allocation.Width == 1) { widget.SizeAllocated += HandleComparisonWidgetSizeAllocated; } else { HandleComparisonWidgetSizeAllocated(null, new Gtk.SizeAllocatedArgs()); } }