Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

allow ShowHiddenDefinitions to be used independently from HighlightBr…

…ackets setting
  • Loading branch information...
commit ac717c602db61ae72ac7041aa999051bb6f93f33 1 parent 6bbb231
@siegfriedpammer siegfriedpammer authored
Showing with 16 additions and 12 deletions.
  1. +16 −12 src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditorView.cs
View
28 src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditorView.cs
@@ -103,26 +103,30 @@ protected override void OnOptionChanged(PropertyChangedEventArgs e)
/// </summary>
void HighlightBrackets(object sender, EventArgs e)
{
- if (CodeEditorOptions.Instance.HighlightBrackets) {
- /*
- * Special case: ITextEditor.Language guarantees that it never returns null.
- * In this case however it can be null, since this code may be called while the document is loaded.
- * ITextEditor.Language gets set in CodeEditorAdapter.FileNameChanged, which is called after
- * loading of the document has finished.
- * */
- if (this.Adapter.Language != null) {
+ /*
+ * Special case: ITextEditor.Language guarantees that it never returns null.
+ * In this case however it can be null, since this code may be called while the document is loaded.
+ * ITextEditor.Language gets set in CodeEditorAdapter.FileNameChanged, which is called after
+ * loading of the document has finished.
+ * */
+ if (this.Adapter.Language != null) {
+ if (CodeEditorOptions.Instance.HighlightBrackets || CodeEditorOptions.Instance.ShowHiddenDefinitions) {
var bracketSearchResult = this.Adapter.Language.BracketSearcher.SearchBracket(this.Adapter.Document, this.TextArea.Caret.Offset);
- this.bracketRenderer.SetHighlight(bracketSearchResult);
-
+ if (CodeEditorOptions.Instance.HighlightBrackets) {
+ this.bracketRenderer.SetHighlight(bracketSearchResult);
+ } else {
+ this.bracketRenderer.SetHighlight(null);
+ }
if (CodeEditorOptions.Instance.ShowHiddenDefinitions) {
this.hiddenDefinitionRenderer.BracketSearchResult = bracketSearchResult;
this.hiddenDefinitionRenderer.Show();
} else {
this.hiddenDefinitionRenderer.ClosePopup();
}
+ } else {
+ this.bracketRenderer.SetHighlight(null);
+ this.hiddenDefinitionRenderer.ClosePopup();
}
- } else {
- this.bracketRenderer.SetHighlight(null);
}
}
#endregion
Please sign in to comment.
Something went wrong with that request. Please try again.