aboutsummaryrefslogtreecommitdiff
path: root/src/Model/SourceLinks.kt
diff options
context:
space:
mode:
authorDmitry Jemerov <yole@jetbrains.com>2015-09-07 20:57:17 +0200
committerDmitry Jemerov <yole@jetbrains.com>2015-09-07 20:57:17 +0200
commit97257371e1594b25395c7c4baaaa92fb98a0ce97 (patch)
treec04101d93fa6b20edb924d0cfe0ea9d3fe403327 /src/Model/SourceLinks.kt
parent3d4cda549bdde68935cb0053dceddb8e64e1e20c (diff)
downloaddokka-97257371e1594b25395c7c4baaaa92fb98a0ce97.tar.gz
dokka-97257371e1594b25395c7c4baaaa92fb98a0ce97.tar.bz2
dokka-97257371e1594b25395c7c4baaaa92fb98a0ce97.zip
work in progress on updating Dokka to latest Kotlin (compiles but does not run yet)
Diffstat (limited to 'src/Model/SourceLinks.kt')
-rw-r--r--src/Model/SourceLinks.kt7
1 files changed, 3 insertions, 4 deletions
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