String (Editor editor, int offset) { int lineNumber = getLineNumber(editor, offset); int lineStart = editor.getDocument().getLineStartOffset(lineNumber); return String.valueOf(offset - lineStart + 1); }