Skip to content

Commit 68ec078

Browse files
committed
Comment selected text
1 parent 57bc0d7 commit 68ec078

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

src/CodeSnip/MainWindow.xaml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@
7272
<KeyBinding Key="K" Modifiers="Ctrl+Shift"
7373
Command="{Binding RelativeSource={RelativeSource AncestorType=Window}, Path=ToggleMultiLineCommentCommand}" />
7474

75-
<!-- Ctrl + Alt + K : Toggle Inline Block Comment (samo selekcija) -->
76-
<KeyBinding Key="K" Modifiers="Ctrl+Alt"
77-
Command="{Binding RelativeSource={RelativeSource AncestorType=Window}, Path=ToggleInlineBlockCommentCommand}" />
75+
<!-- Ctrl + Shift + I : Toggle Inline Block Comment (samo selekcija) -->
76+
<KeyBinding Key="I" Modifiers="Ctrl+Shift"
77+
Command="{Binding RelativeSource={RelativeSource AncestorType=Window}, Path=ToggleCommentSelectionCommand}" />
7878
<!--<KeyBinding Key="F" Modifiers="Ctrl" Command="{Binding SearchReplaceCommand}"/>-->
7979
</mah:MetroWindow.InputBindings>
8080
<mah:MetroWindow.LeftWindowCommands>
@@ -403,6 +403,12 @@
403403
Width="16" Height="16" Stretch="Uniform" />
404404
</MenuItem.Icon>
405405
</MenuItem>
406+
<MenuItem Header="Toggle Selection" Click="ToggleICommentSelection_Click" InputGestureText="Ctrl+Shift+I">
407+
<MenuItem.Icon>
408+
<Path Data="{StaticResource CommentTextMultipleThin}" Fill="{DynamicResource MahApps.Brushes.AccentBase}"
409+
Width="16" Height="16" Stretch="Uniform" />
410+
</MenuItem.Icon>
411+
</MenuItem>
406412
</MenuItem>
407413
<Separator />
408414
<MenuItem Header="Export to">

src/CodeSnip/MainWindow.xaml.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public partial class MainWindow : MetroWindow, IFlyoutService
3030

3131
public ICommand ToggleSingleLineCommentCommand { get; }
3232
public ICommand ToggleMultiLineCommentCommand { get; }
33-
public ICommand ToggleInlineBlockCommentCommand { get; }
33+
public ICommand ToggleCommentSelectionCommand { get; }
3434

3535
public MainWindow()
3636
{
@@ -42,7 +42,7 @@ public MainWindow()
4242
// This wrapping is only to support keyboard shortcuts from the menu items that are bound to these commands.
4343
ToggleSingleLineCommentCommand = new RelayCommand(_ => ToggleSingleLineComment_Click(this, new RoutedEventArgs()));
4444
ToggleMultiLineCommentCommand = new RelayCommand(_ => ToggleMultiLineLineComment_Click(this, new RoutedEventArgs()));
45-
ToggleInlineBlockCommentCommand = new RelayCommand(_ => ToggleInlineBlockComment_Click(this, new RoutedEventArgs()));
45+
ToggleCommentSelectionCommand = new RelayCommand(_ => ToggleICommentSelection_Click(this, new RoutedEventArgs()));
4646

4747
}
4848

@@ -448,8 +448,7 @@ private void ToggleMultiLineLineComment_Click(object sender, RoutedEventArgs e)
448448
}
449449
}
450450

451-
// No menu item for this yet.
452-
private void ToggleInlineBlockComment_Click(object sender, RoutedEventArgs e)
451+
private void ToggleICommentSelection_Click(object sender, RoutedEventArgs e)
453452
{
454453
string? code = mainViewModel.SelectedSnippet?.Category?.Language?.Code;
455454
if (code is not null)

0 commit comments

Comments
 (0)