Browse Source

fixed regression in regex replace: $1 not properly translated

pull/23/head
Siegfried Pammer 14 years ago
parent
commit
e9aedd15fd
  1. 2
      src/AddIns/Misc/SearchAndReplace/Project/Engine/SearchManager.cs
  2. 4
      src/Main/Base/Project/Src/Editor/Search/SearchResultMatch.cs

2
src/AddIns/Misc/SearchAndReplace/Project/Engine/SearchManager.cs

@ -182,7 +182,7 @@ namespace SearchAndReplace @@ -182,7 +182,7 @@ namespace SearchAndReplace
var start = document.GetLocation(result.Offset).ToLocation();
var end = document.GetLocation(result.Offset + result.Length).ToLocation();
var builder = SearchResultsPad.CreateInlineBuilder(start, end, document, highlighter);
results.Add(new SearchResultMatch(fileName, start, end, result.Offset, result.Length, builder));
results.Add(new AvalonEditSearchResultMatch(fileName, start, end, result.Offset, result.Length, builder, result));
}
if (results.Count > 0)
return new SearchedFile(fileName, results);

4
src/Main/Base/Project/Src/Editor/Search/SearchResultMatch.cs

@ -100,11 +100,11 @@ namespace ICSharpCode.SharpDevelop.Editor.Search @@ -100,11 +100,11 @@ namespace ICSharpCode.SharpDevelop.Editor.Search
}
}
public class RegexResultMatch : SearchResultMatch
public class AvalonEditSearchResultMatch : SearchResultMatch
{
ICSharpCode.AvalonEdit.Search.ISearchResult match;
public RegexResultMatch(FileName fileName, Location startLocation, Location endLocation, int offset, int length, HighlightedInlineBuilder builder, ICSharpCode.AvalonEdit.Search.ISearchResult match)
public AvalonEditSearchResultMatch(FileName fileName, Location startLocation, Location endLocation, int offset, int length, HighlightedInlineBuilder builder, ICSharpCode.AvalonEdit.Search.ISearchResult match)
: base(fileName, startLocation, endLocation, offset, length, builder)
{
this.match = match;

Loading…
Cancel
Save