private int getWordAtOffsetStart(int offset, CaretStop wordStop, boolean isCamel) {
      if (offset == 0) {
        return 0;
      }
      if (wordStop.isAtEnd() && !wordStop.isAtStart()) {
        if (EditorActionUtil.isWordOrLexemeEnd(editor, offset, isCamel)) {
          return getWordAtOffsetStart(offset - 1, isCamel);
        }
        if (offset == getLineAtOffsetStart(offset)) {
          return offset - 1;
        }
      }
      if (Character.isWhitespace(editor.getDocument().getText().charAt(offset))) {
        return offset;
      }
      return getWordAtOffsetStart(offset, isCamel);
    }
private int getWordAtOffsetStart(int offset, CaretStop wordStop, boolean isCamel)