diff options
author | Mike Krüger <mkrueger@xamarin.com> | 2012-05-30 12:15:34 +0400 |
---|---|---|
committer | Mike Krüger <mkrueger@xamarin.com> | 2012-05-30 12:15:34 +0400 |
commit | 95fd2fb0cc8f4621f70491f51efbc46e049b9b59 (patch) | |
tree | 5007dad11db0619304276a0334392daa897311bf /main/src | |
parent | e2ea070c27f5d029566e1b6578fb7fb0604240e3 (diff) |
[TextEditor] Fixed failing editor unit tests.
Diffstat (limited to 'main/src')
-rw-r--r-- | main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs | 2 | ||||
-rw-r--r-- | main/src/core/Mono.Texteditor/Mono.TextEditor/Document/TextDocument.cs | 20 |
2 files changed, 11 insertions, 11 deletions
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs index 5f9f132292..8557a19fd9 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs @@ -502,7 +502,7 @@ namespace MonoDevelop.SourceEditor marker.IsFolded = false; } - doc.UpdateFoldSegments (foldSegments, false); + doc.UpdateFoldSegments (foldSegments, false, true); if (reloadSettings) { reloadSettings = false; diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/TextDocument.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/TextDocument.cs index fd74afb2af..d846aeb414 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/TextDocument.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/TextDocument.cs @@ -974,29 +974,29 @@ namespace Mono.TextEditor readonly object syncObject = new object(); - public void UpdateFoldSegments (List<FoldSegment> newSegments) - { - UpdateFoldSegments (newSegments, true); - } - - CancellationTokenSource foldSegmentSrc; Task foldSegmentTask; - public void UpdateFoldSegments (List<FoldSegment> newSegments, bool runInThread) + public void UpdateFoldSegments (List<FoldSegment> newSegments, bool startTask = false, bool useApplicationInvoke = false) { if (newSegments == null) { return; } + Console.WriteLine ("startTask={0}, useApplicationInvoke={1}", startTask, useApplicationInvoke); InterruptFoldWorker (); bool update; - if (!runInThread) { + if (!startTask) { var newFoldedSegments = UpdateFoldSegmentWorker (newSegments, out update); - Gtk.Application.Invoke (delegate { + if (useApplicationInvoke) { + Gtk.Application.Invoke (delegate { + foldedSegments = newFoldedSegments; + InformFoldTreeUpdated (); + }); + } else { foldedSegments = newFoldedSegments; InformFoldTreeUpdated (); - }); + } return; } foldSegmentSrc = new CancellationTokenSource (); |