diff options
Diffstat (limited to 'src/Model')
-rw-r--r-- | src/Model/Content.kt | 2 | ||||
-rw-r--r-- | src/Model/PackageDocs.kt | 4 | ||||
-rw-r--r-- | src/Model/SourceLinks.kt | 7 |
3 files changed, 6 insertions, 7 deletions
diff --git a/src/Model/Content.kt b/src/Model/Content.kt index 810d6417..032de268 100644 --- a/src/Model/Content.kt +++ b/src/Model/Content.kt @@ -142,7 +142,7 @@ public open class MutableContent() : Content() { public override val summary: ContentNode get() = children.firstOrNull() ?: ContentEmpty - public override val description: ContentNode by Delegates.lazy { + public override val description: ContentNode by lazy { val descriptionNodes = children.drop(1) if (descriptionNodes.isEmpty()) { ContentEmpty diff --git a/src/Model/PackageDocs.kt b/src/Model/PackageDocs.kt index 3b0be547..b5ef2126 100644 --- a/src/Model/PackageDocs.kt +++ b/src/Model/PackageDocs.kt @@ -13,8 +13,8 @@ public class PackageDocs(val documentationBuilder: DocumentationBuilder, public val packageContent: Map<String, Content> get() = _packageContent - fun parse(file: String) { - val file = File(file) + fun parse(fileName: String) { + val file = File(fileName) if (file.exists()) { val text = file.readText() val tree = parseMarkdown(text) 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 |