Browse Source

removed orange search result marker, replaced by focus highlight

pull/15/head
Siegfried Pammer 15 years ago
parent
commit
2ae57c2021
  1. 25
      src/AddIns/Misc/SearchAndReplace/Project/Gui/SearchResultNode.cs

25
src/AddIns/Misc/SearchAndReplace/Project/Gui/SearchResultNode.cs

@ -115,30 +115,7 @@ namespace SearchAndReplace @@ -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);
}
}
}

Loading…
Cancel
Save