From 97257371e1594b25395c7c4baaaa92fb98a0ce97 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Mon, 7 Sep 2015 20:57:17 +0200 Subject: work in progress on updating Dokka to latest Kotlin (compiles but does not run yet) --- src/Model/SourceLinks.kt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/Model/SourceLinks.kt') diff --git a/src/Model/SourceLinks.kt b/src/Model/SourceLinks.kt index 4530518f..52de586c 100644 --- a/src/Model/SourceLinks.kt +++ b/src/Model/SourceLinks.kt @@ -50,8 +50,7 @@ fun PsiElement.lineNumber(): Int? { } fun PsiElement.columnNumber(): Int? { - val doc = PsiDocumentManager.getInstance(project).getDocument(containingFile) - // IJ uses 0-based line-numbers; external source browsers use 1-based - val lineNumber = doc?.getLineNumber(textRange.startOffset)?.plus(1) ?: return null - return startOffset - doc!!.getLineStartOffset(lineNumber) + val doc = PsiDocumentManager.getInstance(project).getDocument(containingFile) ?: return null + val lineNumber = doc.getLineNumber(textRange.startOffset) + return startOffset - doc.getLineStartOffset(lineNumber) } \ No newline at end of file -- cgit