Browse Source

Fix #378: CaretReferenceHighlightRenderer cannot be turned off.

pull/444/head
Andreas Weizel 11 years ago
parent
commit
4997ba5dff
  1. 6
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/CaretReferenceHighlightRenderer.cs
  2. 2
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/Options/CodeEditorOptions.cs
  3. 114
      src/Main/Base/Project/Editor/ICodeEditorOptions.cs
  4. 1
      src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj

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

@ -78,6 +78,12 @@ namespace CSharpBinding @@ -78,6 +78,12 @@ namespace CSharpBinding
public void Draw(TextView textView, DrawingContext drawingContext)
{
var codeEditorOptions = editor.Options as ICodeEditorOptions;
if ((codeEditorOptions != null) && !codeEditorOptions.HighlightSymbol) {
// User has disabled highlighting of symbols
return;
}
if (currentReferences == null) {
if (textView.VisualLines.Count == 0)
return;

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

@ -27,7 +27,7 @@ using ICSharpCode.SharpDevelop.Gui; @@ -27,7 +27,7 @@ using ICSharpCode.SharpDevelop.Gui;
namespace ICSharpCode.AvalonEdit.AddIn.Options
{
[Serializable]
public class CodeEditorOptions : TextEditorOptions, ITextEditorOptions
public class CodeEditorOptions : TextEditorOptions, ITextEditorOptions, ICodeEditorOptions
{
static readonly Lazy<CodeEditorOptions> instance = new Lazy<CodeEditorOptions>(
() => PropertyService.Get("CodeEditorOptions", new CodeEditorOptions()));

114
src/Main/Base/Project/Editor/ICodeEditorOptions.cs

@ -0,0 +1,114 @@ @@ -0,0 +1,114 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.ComponentModel;
namespace ICSharpCode.SharpDevelop.Editor
{
/// <summary>
/// Code editor options.
/// </summary>
public interface ICodeEditorOptions : INotifyPropertyChanged
{
bool AllowScrollBelowDocument {
get;
set;
}
string FontFamily {
get;
set;
}
double FontSize {
get;
set;
}
bool ShowLineNumbers {
get;
set;
}
bool EnableChangeMarkerMargin {
get;
set;
}
bool WordWrap {
get;
set;
}
bool CtrlClickGoToDefinition {
get;
set;
}
bool MouseWheelZoom {
get;
set;
}
bool UnderlineErrors {
get;
set;
}
bool HighlightBrackets {
get;
set;
}
bool HighlightSymbol {
get;
set;
}
bool EnableAnimations {
get;
set;
}
bool UseSmartIndentation {
get;
set;
}
bool EnableFolding {
get;
set;
}
bool EnableQuickClassBrowser {
get;
set;
}
bool ShowHiddenDefinitions {
get;
set;
}
bool AutoInsertBlockEnd {
get;
set;
}
}
}

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

@ -147,6 +147,7 @@ @@ -147,6 +147,7 @@
<Compile Include="Editor\DocumentServiceAttribute.cs" />
<Compile Include="Editor\DocumentUtilities.cs" />
<Compile Include="Editor\IBracketSearcher.cs" />
<Compile Include="Editor\ICodeEditorOptions.cs" />
<Compile Include="Editor\IDocumentVersionProvider.cs" />
<Compile Include="Editor\IEditorControlService.cs" />
<Compile Include="Editor\IEditorUIService.cs" />

Loading…
Cancel
Save