private int getWordAtOffsetStart(int offset, boolean isCamel) {
      Document document = editor.getDocument();
      if (offset == 0) {
        return 0;
      }
      int lineNumber = editor.offsetToLogicalPosition(offset).line;
      int newOffset = offset;
      int minOffset = lineNumber > 0 ? document.getLineEndOffset(lineNumber - 1) : 0;
      for (; newOffset > minOffset; newOffset--) {
        if (EditorActionUtil.isWordOrLexemeStart(editor, newOffset, isCamel)) {
          break;
        }
      }

      return newOffset;
    }
private int getWordAtOffsetStart(int offset, boolean isCamel)