Skip to content

Commit

Permalink
Merge pull request #465 from BlueDotBrigade/Features/375-Bookends
Browse files Browse the repository at this point in the history
Merge branch to `main` for: bookend feature support #375
  • Loading branch information
Pressacco authored Nov 27, 2024
2 parents 8ad2f0b + e58ba6a commit cd4abc3
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Src/BlueDotBrigade.Weevil.Core/Bookend.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ namespace BlueDotBrigade.Weevil
{
internal class Bookend
{
public string Name { get; }

public int StartLineNumber { get; }
public int EndLineNumber { get; }

public Bookend(int startLineNumber, int endLineNumber)
{
{ this.Name = string.Empty;
this.StartLineNumber = startLineNumber;
this.EndLineNumber = endLineNumber;
}
Expand Down
6 changes: 6 additions & 0 deletions Src/BlueDotBrigade.Weevil.Gui/Filter/FilterView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@

<KeyBinding Key="M" Modifiers="Ctrl+Shift" Command="{Binding FilterByCommentCommand}" />

<KeyBinding Key="B" Modifiers="Control" Command="{Binding CreateBookendCommand}"/>

<KeyBinding Key="P" Modifiers="Control" Command="{Binding ToggleIsPinnedCommand}"/>
<KeyBinding Key="Subtract" Modifiers="Control" Command="{Binding GoToPreviousPinCommand}" />
<KeyBinding Key="Add" Modifiers="Control" Command="{Binding GoToNextPinCommand}" />
Expand Down Expand Up @@ -256,6 +258,10 @@
<Separator/>
<MenuItem Header="Paste Comments" Command="{Binding ClipboardPasteCommand}" InputGestureText="Ctrl+V" />
<MenuItem Header="Overwrite Comments" Command="{Binding ClipboardPasteOverwriteCommand}" InputGestureText="Ctrl+Shift+V" />
<Separator/>
<MenuItem Header="Add Bookend" Command="{Binding AddBookendCommand}" InputGestureText="Ctrl+B" />
<MenuItem Header="Remove Bookends" Command="{Binding RemoveBookendsCommand}" />
<MenuItem Header="Clear Outside Bookends" Command="{Binding ClearOutsideBookendsCommand}" />
</MenuItem>
<Separator/>
<MenuItem Header="Filtering...">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,5 +264,11 @@ internal partial class FilterViewModel
[SafeForDependencyAnalysis]
public ICommand ToggleIsPinnedCommand => new UiBoundCommand(ToggleIsPinned, () => this.IsMenuEnabled);
#endregion

#region Commands: Bookmarks
public ICommand AddBookendCommand => new UiBoundCommand(AddBookend, () => this.IsMenuEnabled);
public ICommand RemoveBookendsCommand => new UiBoundCommand(RemoveBookends, () => this.IsMenuEnabled);
public ICommand ClearOutsideBookendsCommand => new UiBoundCommand(ClearOutsideBookends, () => this.IsMenuEnabled);
#endregion
}
}
16 changes: 16 additions & 0 deletions Src/BlueDotBrigade.Weevil.Gui/Filter/FilterViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1179,10 +1179,26 @@ public void Analyze(string customAnalyzerKey)
}
}

private void AddBookend()
{
throw new NotImplementedException();
}

private void RemoveBookends()
{
throw new NotImplementedException();
}

private void ClearOutsideBookends()
{
throw new NotImplementedException();
}

private void ToggleIsPinned()
{
_engine.Selector.ToggleIsPinned();
}

public void UnpinAll()
{
_engine.Analyzer.UnpinAll();
Expand Down

0 comments on commit cd4abc3

Please sign in to comment.