Skip to content

Commit

Permalink
Rebasing Changes.
Browse files Browse the repository at this point in the history
Signed-off-by: yashTEF <yashsoc@gmail.com>
  • Loading branch information
yashTEF authored and datho7561 committed May 27, 2021
1 parent c2c6b2e commit 6359bd3
Showing 1 changed file with 2 additions and 14 deletions.
Expand Up @@ -74,7 +74,6 @@ private int findLine(int offset) {

if (fLines.size() == 0) {
return -1;
<<<<<<< HEAD
}
int left = 0;
int right = fLines.size();
Expand All @@ -88,7 +87,6 @@ private int findLine(int offset) {
}
}
return (fLines.get(left).offset > offset) ? left - 1 : left;
>>>>>>> Refactored findLine() Implementation
}

@Override
Expand Down Expand Up @@ -217,27 +215,17 @@ public int getOffsetAt(Position position) throws BadLocationException {

@Override
public final Line getLineInformationOfOffset(int position) throws BadLocationException {
<<<<<<< HEAD
if (position > fTextLength) {
throw new BadLocationException("Offset > length: " + position + " > " + fTextLength); //$NON-NLS-1$//$NON-NLS-2$
}

if (position == fTextLength) {
int size= fLines.size();
int size = fLines.size();
if (size == 0) {
return new Line(0, 0);
}
Line l= fLines.get(size - 1);
=======
if (position > fTextLength)
throw new BadLocationException("Offset > length: " + position + " > " + fTextLength); //$NON-NLS-1$//$NON-NLS-2$

if (position == fTextLength) {
int size = fLines.size();
if (size == 0)
return new Line(0, 0);
Line l = fLines.get(size - 1);
>>>>>>> Refactored findLine() Implementation

return (l.delimiter != null ? new Line(fTextLength, 0) : new Line(fTextLength - l.length, l.length));
}

Expand Down

0 comments on commit 6359bd3

Please sign in to comment.