Source:
<code>private void drawLineRange(GC gc, int startLine, int endLine, int x, int w) { final int viewPortWidth= fTextWidget.getClientArea().width; int spaceCharWidth= gc.stringExtent(" ").x; boolean spaceCharsAreSameWidth= spaceCharWidth == gc.stringExtent(SPACE_SIGN_STRING).x && spaceCharWidth == gc.stringExtent(IDEOGRAPHIC_SPACE_SIGN_STRING).x; for (int line= startLine; line <= endLine; line++) { int lineOffset= fTextWidget.getOffsetAtLine(line); int lineEndOffset; if (line < fTextWidget.getLineCount() - 1) { lineEndOffset= fTextWidget.getOffsetAtLine(line + 1); } else { lineEndOffset= fTextWidget.getCharCount(); } int lineLength= lineEndOffset - lineOffset; while (lineLength > 0) { char c= fTextWidget.getTextRange(lineOffset + lineLength - 1, 1).charAt(0); if (c != '\r' && c != '\n') { break; } --lineLength; } Point endOfLine= fTextWidget.getLocationAtOffset(lineOffset + lineLength); if (x - endOfLine.x > viewPortWidth) { continue; } int y= fTextWidget.getLinePixel(line); int startOffset = fTextWidget.getOffsetAtPoint(new Point(x, y)) - 1; if (startOffset == -1) { startOffset= lineOffset; } else if (startOffset - 2 <= lineOffset) { startOffset= lineOffset; } int endOffset; if (x + w >= endOfLine.x) { endOffset= lineEndOffset; } else { endOffset= fTextWidget.getOffsetAtPoint(new Point(x + w - 1, y)) + 1; if (endOffset == -1) { endOffset= lineEndOffset; } <START> if (endOffset <END> + 2 >= lineEndOffset) { endOffset= lineEndOffset; } } if (endOffset > startOffset) { drawCharRange(gc, startOffset, endOffset, lineOffset, lineEndOffset, spaceCharsAreSameWidth); } } }</code><technical_language>else if</technical_language>

Target:
private void drawLineRange(GC gc, int startLine, int endLine, int x, int w) { final int viewPortWidth= fTextWidget.getClientArea().width; int spaceCharWidth= gc.stringExtent(" ").x; boolean spaceCharsAreSameWidth= spaceCharWidth == gc.stringExtent(SPACE_SIGN_STRING).x && spaceCharWidth == gc.stringExtent(IDEOGRAPHIC_SPACE_SIGN_STRING).x; for (int line= startLine; line <= endLine; line++) { int lineOffset= fTextWidget.getOffsetAtLine(line); int lineEndOffset; if (line < fTextWidget.getLineCount() - 1) { lineEndOffset= fTextWidget.getOffsetAtLine(line + 1); } else { lineEndOffset= fTextWidget.getCharCount(); } int lineLength= lineEndOffset - lineOffset; while (lineLength > 0) { char c= fTextWidget.getTextRange(lineOffset + lineLength - 1, 1).charAt(0); if (c != '\r' && c != '\n') { break; } --lineLength; } Point endOfLine= fTextWidget.getLocationAtOffset(lineOffset + lineLength); if (x - endOfLine.x > viewPortWidth) { continue; } int y= fTextWidget.getLinePixel(line); int startOffset = fTextWidget.getOffsetAtPoint(new Point(x, y)) - 1; if (startOffset == -1) { startOffset= lineOffset; } else if (startOffset - 2 <= lineOffset) { startOffset= lineOffset; } int endOffset; if (x + w >= endOfLine.x) { endOffset= lineEndOffset; } else { endOffset= fTextWidget.getOffsetAtPoint(new Point(x + w - 1, y)) + 1; if (endOffset == -1) { endOffset= lineEndOffset; } else if (endOffset + 2 >= lineEndOffset) { endOffset= lineEndOffset; } } if (endOffset > startOffset) { drawCharRange(gc, startOffset, endOffset, lineOffset, lineEndOffset, spaceCharsAreSameWidth); } } }