diff options
author | Mike Krüger <mikkrg@microsoft.com> | 2019-03-29 12:18:40 +0300 |
---|---|---|
committer | Mike Krüger <mikkrg@microsoft.com> | 2019-04-01 11:00:37 +0300 |
commit | 110b8f3554ba683a5f053ae44d3e497916c306fb (patch) | |
tree | d5f8cdcd5b9d496d4e75b6352d7e294b05430960 /main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/MergeWidget.cs | |
parent | eac5cf0c56d364b997d4d9498559cfe6c85912fc (diff) |
Fixes VSTS Bug 691624: [Feedback] Visual studio marks git conflicts
resolved
https://devdiv.visualstudio.com/DevDiv/_workitems/edit/691624
The bug itself is fixed in the 8.0 branch - however merge is badly
broken so fixing the merge view itself is important.
Diffstat (limited to 'main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/MergeWidget.cs')
-rw-r--r-- | main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/MergeWidget.cs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/MergeWidget.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/MergeWidget.cs index a4eb5f96ea..1993a9d971 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/MergeWidget.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/MergeWidget.cs @@ -73,6 +73,10 @@ namespace MonoDevelop.VersionControl.Views { base.info = info; // SetLocal calls create diff & sets UpdateDiff handler -> should be connected after diff is created + var mimeType = DesktopService.GetMimeTypeForUri (info.Item.Path); + foreach (var editor in editors) { + editor.Document.MimeType = mimeType; + } SetLocal (MainEditor.GetTextEditorData ()); Show (); } @@ -167,6 +171,11 @@ namespace MonoDevelop.VersionControl.Views this.DividerSegment = dividerSegment; this.EndSegment = endSegment; } + + public override string ToString () + { + return $"[Conflict: MySegment={MySegment}, TheirSegment={TheirSegment}, StartSegment={StartSegment}, DividerSegment={DividerSegment}, EndSegment={EndSegment}]"; + } } List<Conflict> currentConflicts = new List<Conflict> (); @@ -207,6 +216,7 @@ namespace MonoDevelop.VersionControl.Views currentConflicts = new List<Conflict> (Conflicts (MainEditor.Document)); leftConflicts.Clear (); rightConflicts.Clear (); + editors[0].Document.IsReadOnly = editors[2].Document.IsReadOnly = false; editors[0].Document.Text = ""; editors[2].Document.Text = ""; @@ -237,6 +247,7 @@ namespace MonoDevelop.VersionControl.Views string lastPart = MainEditor.Document.GetTextBetween (endOffset, MainEditor.Document.Length); editors[0].Insert (editors[0].Document.Length, lastPart); editors[2].Insert (editors[2].Document.Length, lastPart); + editors[0].Document.IsReadOnly = editors[2].Document.IsReadOnly = true; UpdateDiff (); } |