[intention-preview] Better check for commit

For binary file copies, isPhysical returns false but viewProvider.isEventSystemEnabled returns true, which causes invalid commit operation

GitOrigin-RevId: 91dfcc355a9cc3d51b15db2b20e9c8b206435106
This commit is contained in:
Tagir Valeev
2024-07-04 21:05:23 +00:00
committed by intellij-monorepo-bot
parent 1ad1289917
commit d345431d4a
@@ -130,7 +130,7 @@ class IntentionPreviewComputable(private val project: Project,
}
Reference.reachabilityFence(settings)
val manager = PsiDocumentManager.getInstance(project)
if (!psiFileCopy.isPhysical) {
if (!psiFileCopy.viewProvider.isEventSystemEnabled) {
manager.commitDocument(editorCopy.document)
manager.doPostponedOperationsAndUnblockDocument(editorCopy.document)
}