From d345431d4a2615759d19304486b101bf17ce754e Mon Sep 17 00:00:00 2001 From: Tagir Valeev Date: Thu, 4 Jul 2024 18:22:17 +0200 Subject: [PATCH] [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 --- .../intention/impl/preview/IntentionPreviewComputable.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/intention/impl/preview/IntentionPreviewComputable.kt b/platform/lang-impl/src/com/intellij/codeInsight/intention/impl/preview/IntentionPreviewComputable.kt index 3614d571c03f..1a485d2e3f3c 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/intention/impl/preview/IntentionPreviewComputable.kt +++ b/platform/lang-impl/src/com/intellij/codeInsight/intention/impl/preview/IntentionPreviewComputable.kt @@ -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) }