diff --git a/Codist/SmartBars/SmartBar.CommonEdit.cs b/Codist/SmartBars/SmartBar.CommonEdit.cs index 6e9c59fb..cb18a441 100644 --- a/Codist/SmartBars/SmartBar.CommonEdit.cs +++ b/Codist/SmartBars/SmartBar.CommonEdit.cs @@ -195,15 +195,14 @@ protected void AddCommentCommand(System.Windows.Controls.ToolBar toolBar) { void AddEditAllMatchingCommand() { AddCommand(ToolBar, IconIds.EditMatches, R.CMD_EditMatches, ctx => { - var spans = ctx.View.Selection.SelectedSpans; - if (spans.Count < 1) { + var b = ctx.View.GetMultiSelectionBroker(); + if (b.HasMultipleSelections || b.PrimarySelection.IsEmpty) { return; } - var s = spans[0]; + var s = b.PrimarySelection.Extent.SnapshotSpan; if (s.Length == 0) { return; } - var b = ctx.View.GetMultiSelectionBroker(); var option = FindOptions.Wrap | FindOptions.OrdinalComparison; var m = ctx.ModifierKeys; if (m.MatchFlags(ModifierKeys.Control)) {