int () { Document document = getDocument(); if (document == null) return -1; int offset = getUsageInfo().getNavigationOffset(); if (offset == -1) offset = myOffset; if (offset >= document.getTextLength()) { int line = Math.max(0, Math.min(myLineNumber, document.getLineCount() - 1)); offset = document.getLineStartOffset(line); } return offset; }