Triple clicking a paragraph should select it. This works fine if you triple click the first paragraph. If you click any other paragraph, it will select some text before that paragraph.
This could be due to the fact that CaretSelectionBindImpl.moveToParEnd doesn't take into account that the cursor may not be in the first paragraph. It calculates new position as:
int newPos = getArea().getParagraphLength(getParagraphIndex());
This position is ok relative to the current paragraph, but the next line (moveTo) apparently expects absolute position:
moveTo(newPos, selectionPolicy);
Compare that with moveTo in moveToParStart:
moveTo(getPosition() - getColumnPosition(), selectionPolicy);
In other words, moveTo in moveToParEnd should probably be:
moveTo(newPos + getPosition() - getColumnPosition(), selectionPolicy);
Triple clicking a paragraph should select it. This works fine if you triple click the first paragraph. If you click any other paragraph, it will select some text before that paragraph.
This could be due to the fact that CaretSelectionBindImpl.moveToParEnd doesn't take into account that the cursor may not be in the first paragraph. It calculates new position as:
int newPos = getArea().getParagraphLength(getParagraphIndex());
This position is ok relative to the current paragraph, but the next line (moveTo) apparently expects absolute position:
moveTo(newPos, selectionPolicy);
Compare that with moveTo in moveToParStart:
moveTo(getPosition() - getColumnPosition(), selectionPolicy);
In other words, moveTo in moveToParEnd should probably be:
moveTo(newPos + getPosition() - getColumnPosition(), selectionPolicy);