Merge pull request #8798 from uinstinct/read-document-fallback
fallback to vsfutil.loadtext when readDocument is null
This commit is contained in:
commit
9a08e2b75f
1 changed files with 1 additions and 1 deletions
|
|
@ -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))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue