diff options
author | Mike Krüger <mkrueger@xamarin.com> | 2015-02-26 20:57:09 +0300 |
---|---|---|
committer | Mike Krüger <mkrueger@xamarin.com> | 2015-02-26 20:57:29 +0300 |
commit | e8120ebd0c9ee45a83e48ae431e65797c172403f (patch) | |
tree | f80eae1b9ad1dac3561709b1ecac304eacb48374 /main/src/addins/MonoDevelop.SourceEditor2 | |
parent | a5b702cb5e3d6d7406da472536164ba3534be6b2 (diff) |
[SourceEditor] Fixed error underline on the fly toggleing.
Diffstat (limited to 'main/src/addins/MonoDevelop.SourceEditor2')
2 files changed, 23 insertions, 11 deletions
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/MarkerPanel.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/MarkerPanel.cs index c0407b6177..f983b9f003 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/MarkerPanel.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/MarkerPanel.cs @@ -27,6 +27,7 @@ using System; using MonoDevelop.Ide.Gui.Dialogs; using MonoDevelop.Core; using Mono.TextEditor; +using MonoDevelop.Ide; namespace MonoDevelop.SourceEditor.OptionPanels { @@ -71,6 +72,9 @@ namespace MonoDevelop.SourceEditor.OptionPanels this.underlineErrorsCheckbutton.Active = underlineErrors = DefaultSourceEditorOptions.Instance.UnderlineErrors; this.underlineErrorsCheckbutton.Toggled += delegate { DefaultSourceEditorOptions.Instance.UnderlineErrors = this.underlineErrorsCheckbutton.Active; + foreach (var doc in IdeApp.Workbench.Documents) + doc.StartReparseThread (); + }; this.highlightMatchingBracketCheckbutton.Active = highlightMatchingBracket = DefaultSourceEditorOptions.Instance.HighlightMatchingBracket; diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs index 640d12ceef..1bbece011a 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs @@ -623,8 +623,16 @@ namespace MonoDevelop.SourceEditor void UpdateErrorUndelines (ParsedDocument parsedDocument) { - if (!options.UnderlineErrors || parsedDocument == null) + if (!options.UnderlineErrors || parsedDocument == null) { + Application.Invoke (delegate { + var doc = this.TextEditor != null ? this.TextEditor.Document : null; + if (doc == null) + return; + RemoveErrorUnderlines (doc); + UpdateQuickTasks (parsedDocument); + }); return; + } Application.Invoke (delegate { if (!quickTaskProvider.Contains (this)) @@ -636,7 +644,7 @@ namespace MonoDevelop.SourceEditor Document doc = this.TextEditor != null ? this.TextEditor.Document : null; if (doc != null) { RemoveErrorUnderlines (doc); - + // Else we underline the error if (parsedDocument.Errors != null) { foreach (var error in parsedDocument.Errors) @@ -1687,17 +1695,17 @@ namespace MonoDevelop.SourceEditor void UpdateQuickTasks (ParsedDocument doc) { tasks.Clear (); + if (doc != null) { + foreach (var cmt in doc.TagComments) { + var newTask = new QuickTask (cmt.Text, cmt.Region.Begin, Severity.Hint); + tasks.Add (newTask); + } - foreach (var cmt in doc.TagComments) { - var newTask = new QuickTask (cmt.Text, cmt.Region.Begin, Severity.Hint); - tasks.Add (newTask); - } - - foreach (var error in doc.Errors) { - var newTask = new QuickTask (error.Message, error.Region.Begin, error.ErrorType == ErrorType.Error ? Severity.Error : Severity.Warning); - tasks.Add (newTask); + foreach (var error in doc.Errors) { + var newTask = new QuickTask (error.Message, error.Region.Begin, error.ErrorType == ErrorType.Error ? Severity.Error : Severity.Warning); + tasks.Add (newTask); + } } - OnTasksUpdated (EventArgs.Empty); } #endregion |