1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-08 10:16:03 +02:00

Remove trailing whitespace in matches.

This commit is contained in:
Sergey Prigogin 2010-05-13 07:32:10 +00:00
parent 43dbe6cc86
commit a9a8a0baf1

View file

@ -87,11 +87,12 @@ public class LineSearchElement extends PDOMSearchElement {
private final Match[] fMatches; private final Match[] fMatches;
private final static MatchesComparator MATCHES_COMPARATOR = new MatchesComparator(); private final static MatchesComparator MATCHES_COMPARATOR = new MatchesComparator();
private LineSearchElement(IIndexFileLocation file, Match[] matches, int number, String content, int offset) { private LineSearchElement(IIndexFileLocation file, Match[] matches, int number, String content,
int offset) {
super(file); super(file);
fMatches = matches; fMatches = matches;
fNumber = number; fNumber = number;
// skip whitespace at the beginning // Skip whitespace at the beginning.
int index = 0; int index = 0;
int length = content.length(); int length = content.length();
int firstMatchOffset = matches[0].getOffset(); int firstMatchOffset = matches[0].getOffset();
@ -103,7 +104,7 @@ public class LineSearchElement extends PDOMSearchElement {
length--; length--;
} }
fOffset = offset; fOffset = offset;
fContent = content.substring(index); fContent = content.substring(index).trim();
} }
public int getOffset() { public int getOffset() {