Skip to content

Commit

Permalink
Add and export a ViewOptionDefinition for controlling visibility of t…
Browse files Browse the repository at this point in the history
…he diff margin
  • Loading branch information
sharwell committed Feb 7, 2013
1 parent f560439 commit e37e0b0
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
2 changes: 2 additions & 0 deletions BasicSccProvider.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
<ItemGroup>
<Compile Include="Diff\BackgroundParser.cs" />
<Compile Include="Diff\DiffFormatNames.cs" />
<Compile Include="Diff\DiffMarginEnabled.cs" />
<Compile Include="Diff\DiffParseResultEventArgs.cs" />
<Compile Include="Diff\DiffRemovedEditorFormatDefinition.cs" />
<Compile Include="Diff\DiffModificationEditorFormatDefinition.cs" />
Expand All @@ -105,6 +106,7 @@
<Compile Include="Diff\DiffMarginFactory.cs" />
<Compile Include="Diff\DiffUpdateBackgroundParser.cs" />
<Compile Include="Diff\GitCommands.cs" />
<Compile Include="Diff\GitTextViewOptions.cs" />
<Compile Include="Diff\HunkRange.cs" />
<Compile Include="Diff\HunkRangeInfo.cs" />
<Compile Include="Diff\IGitCommands.cs" />
Expand Down
27 changes: 27 additions & 0 deletions Diff/DiffMarginEnabled.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
namespace GitScc.Diff
{
using System.ComponentModel.Composition;
using Microsoft.VisualStudio.Text.Editor;
using Microsoft.VisualStudio.Utilities;

[Export(typeof(EditorOptionDefinition))]
[Name(GitTextViewOptions.DiffMarginName)]
public sealed class DiffMarginEnabled : ViewOptionDefinition<bool>
{
public override bool Default
{
get
{
return true;
}
}

public override EditorOptionKey<bool> Key
{
get
{
return GitTextViewOptions.DiffMarginId;
}
}
}
}
11 changes: 11 additions & 0 deletions Diff/GitTextViewOptions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace GitScc.Diff
{
using Microsoft.VisualStudio.Text.Editor;

public static class GitTextViewOptions
{
public const string DiffMarginName = "GitScc/DiffMarginName";

public static readonly EditorOptionKey<bool> DiffMarginId = new EditorOptionKey<bool>(DiffMarginName);
}
}

0 comments on commit e37e0b0

Please sign in to comment.