diff --git a/src/AddIns/Misc/SearchAndReplace/Project/Gui/SearchResultNode.cs b/src/AddIns/Misc/SearchAndReplace/Project/Gui/SearchResultNode.cs index db859762f8..6c40152acf 100644 --- a/src/AddIns/Misc/SearchAndReplace/Project/Gui/SearchResultNode.cs +++ b/src/AddIns/Misc/SearchAndReplace/Project/Gui/SearchResultNode.cs @@ -115,30 +115,7 @@ namespace SearchAndReplace public override void ActivateItem() { - var location = anchor.Location; - ITextEditorProvider provider = FileService.JumpToFilePosition(anchor.FileName, location.Line, location.Column) as ITextEditorProvider; - if (provider != null) { - ITextMarkerService markerService = provider.TextEditor.GetService(typeof(ITextMarkerService)) as ITextMarkerService; - if (markerService != null) { - ITextMarker marker = null; - try { - marker = markerService.Create(provider.TextEditor.Document.PositionToOffset(location.Line, location.Column), result.Length); - } catch (ArgumentOutOfRangeException) { - // can happen if lineNumber/column is after the end of the document; or if - // result.Length is too long - } - if (marker != null) { - marker.BackgroundColor = Colors.Orange; - marker.Tag = this; - EventHandler remover = null; - remover = (sender, e) => { - marker.Delete(); - provider.TextEditor.Caret.PositionChanged -= remover; - }; - provider.TextEditor.Caret.PositionChanged += remover; - } - } - } + FileService.JumpToFilePosition(anchor.FileName, anchor.Location.Line, anchor.Location.Column); } } }