private int getWordAtOffsetEnd(int offset, CaretStop stopWord, boolean isCamel) {
      if (stopWord.isAtStart()) {
        if (Character.isWhitespace(editor.getDocument().getText().charAt(offset))) {
          return offset + 1;
        }
        return getWordAtOffsetEnd(offset + 1, isCamel);
      }
      if (offset == getLineAtOffsetStart(offset)) {
        return offset;
      }
      return getWordAtOffsetEnd(offset, isCamel);
    }
private int getWordAtOffsetEnd(int offset, CaretStop stopWord, boolean isCamel)