Merge pull request #8798 from uinstinct/read-document-fallback

fallback to vsfutil.loadtext when readDocument is null
This commit is contained in:
Dallin Romney 2025-11-21 14:37:42 -08:00 • committed by GitHub
commit 9a08e2b75f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -91,7 +91,7 @@ class FileUtils(
private fun readDocument(file: VirtualFile, maxLength: Int): String? {
val document = FileDocumentManager.getInstance().getDocument(file)
?: return ""
?: return null
val length = min(document.textLength, maxLength)
return document.getText(TextRange(0, length))
}