boolean (CaretImpl caret) { if (!caret.isUpToDate()) { return false; } EditorImpl editor = caret.getEditor(); SoftWrapModel softWrapModel = editor.getSoftWrapModel(); int offset = caret.getOffset(); SoftWrap softWrap = softWrapModel.getSoftWrap(offset); if (softWrap == null) { return false; } VisualPosition afterWrapPosition = editor.offsetToVisualPosition(offset, false, false); VisualPosition caretPosition = caret.getVisualPosition(); return caretPosition.line == afterWrapPosition.line && caretPosition.column <= afterWrapPosition.column; }