Exemple #1
0
 @Override
 protected void placeCursor() {
   Position pos = editorAdaptor.getPosition();
   int offset = pos.getViewOffset();
   LineInformation line = editorAdaptor.getViewContent().getLineInformationOfOffset(offset);
   if (isEnabled && line.getEndOffset() == offset && line.getLength() > 0) {
     editorAdaptor.setPosition(pos.addViewOffset(-1), false);
   }
 }
Exemple #2
0
 @Override
 protected void placeCursor() {
   final Position pos = editorAdaptor.getPosition();
   final int offset = pos.getViewOffset();
   final LineInformation line = editorAdaptor.getViewContent().getLineInformationOfOffset(offset);
   if (isEnabled && line.getEndOffset() == offset && line.getLength() > 0) {
     editorAdaptor.setPosition(pos.addViewOffset(-1), StickyColumnPolicy.NEVER);
   }
 }
 @Override
 protected int destination(int offset, TextContent content, int count) {
   int result = Math.max(0, offset - count);
   LineInformation lineInformation = content.getLineInformationOfOffset(offset);
   if (result < lineInformation.getBeginOffset()) {
     LineInformation resultLine = content.getLineInformation(lineInformation.getNumber() - 1);
     result = resultLine.getEndOffset();
   }
   return result;
 }