Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Commit 4997ba5

Browse files
committed
Fix #378: CaretReferenceHighlightRenderer cannot be turned off.
1 parent 62e91ac commit 4997ba5

4 files changed

Lines changed: 122 additions & 1 deletion

File tree

src/AddIns/BackendBindings/CSharpBinding/Project/Src/CaretReferenceHighlightRenderer.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@ public void Dispose()
7878

7979
public void Draw(TextView textView, DrawingContext drawingContext)
8080
{
81+
var codeEditorOptions = editor.Options as ICodeEditorOptions;
82+
if ((codeEditorOptions != null) && !codeEditorOptions.HighlightSymbol) {
83+
// User has disabled highlighting of symbols
84+
return;
85+
}
86+
8187
if (currentReferences == null) {
8288
if (textView.VisualLines.Count == 0)
8389
return;

src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/Options/CodeEditorOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
namespace ICSharpCode.AvalonEdit.AddIn.Options
2828
{
2929
[Serializable]
30-
public class CodeEditorOptions : TextEditorOptions, ITextEditorOptions
30+
public class CodeEditorOptions : TextEditorOptions, ITextEditorOptions, ICodeEditorOptions
3131
{
3232
static readonly Lazy<CodeEditorOptions> instance = new Lazy<CodeEditorOptions>(
3333
() => PropertyService.Get("CodeEditorOptions", new CodeEditorOptions()));
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
2+
//
3+
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
4+
// software and associated documentation files (the "Software"), to deal in the Software
5+
// without restriction, including without limitation the rights to use, copy, modify, merge,
6+
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
7+
// to whom the Software is furnished to do so, subject to the following conditions:
8+
//
9+
// The above copyright notice and this permission notice shall be included in all copies or
10+
// substantial portions of the Software.
11+
//
12+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
13+
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
14+
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
15+
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
16+
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
17+
// DEALINGS IN THE SOFTWARE.
18+
19+
using System;
20+
using System.ComponentModel;
21+
22+
namespace ICSharpCode.SharpDevelop.Editor
23+
{
24+
/// <summary>
25+
/// Code editor options.
26+
/// </summary>
27+
public interface ICodeEditorOptions : INotifyPropertyChanged
28+
{
29+
bool AllowScrollBelowDocument {
30+
get;
31+
set;
32+
}
33+
34+
string FontFamily {
35+
get;
36+
set;
37+
}
38+
39+
double FontSize {
40+
get;
41+
set;
42+
}
43+
44+
bool ShowLineNumbers {
45+
get;
46+
set;
47+
}
48+
49+
bool EnableChangeMarkerMargin {
50+
get;
51+
set;
52+
}
53+
54+
bool WordWrap {
55+
get;
56+
set;
57+
}
58+
59+
bool CtrlClickGoToDefinition {
60+
get;
61+
set;
62+
}
63+
64+
bool MouseWheelZoom {
65+
get;
66+
set;
67+
}
68+
69+
bool UnderlineErrors {
70+
get;
71+
set;
72+
}
73+
74+
bool HighlightBrackets {
75+
get;
76+
set;
77+
}
78+
79+
bool HighlightSymbol {
80+
get;
81+
set;
82+
}
83+
84+
bool EnableAnimations {
85+
get;
86+
set;
87+
}
88+
89+
bool UseSmartIndentation {
90+
get;
91+
set;
92+
}
93+
94+
bool EnableFolding {
95+
get;
96+
set;
97+
}
98+
99+
bool EnableQuickClassBrowser {
100+
get;
101+
set;
102+
}
103+
104+
bool ShowHiddenDefinitions {
105+
get;
106+
set;
107+
}
108+
109+
bool AutoInsertBlockEnd {
110+
get;
111+
set;
112+
}
113+
}
114+
}

src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@
147147
<Compile Include="Editor\DocumentServiceAttribute.cs" />
148148
<Compile Include="Editor\DocumentUtilities.cs" />
149149
<Compile Include="Editor\IBracketSearcher.cs" />
150+
<Compile Include="Editor\ICodeEditorOptions.cs" />
150151
<Compile Include="Editor\IDocumentVersionProvider.cs" />
151152
<Compile Include="Editor\IEditorControlService.cs" />
152153
<Compile Include="Editor\IEditorUIService.cs" />

0 commit comments

Comments
 (0)