boolean (Editor editor, Document doc, int offset, PsiElement current) { if (current == null) return false; if (current.getParent() instanceof XmlText) { final int line = doc.getLineNumber(offset); final int lineStart = doc.getLineStartOffset(line); final int lineEnd = doc.getLineEndOffset(line); final CharSequence text = doc.getCharsSequence().subSequence(lineStart, lineEnd); if (StringUtil.isEmptyOrSpaces(text) && moveCaret(editor, current, lineEnd)) { return true; } } else if (isEmptyEditPoint(current) && moveCaret(editor, current, current.getTextRange().getStartOffset())) { return true; } return false; }