mirror of
https://github.com/ilyakooo0/intellij-haskell.git
synced 2024-08-17 02:30:42 +03:00
Run doPostponedOperationsAndUnblockDocument in read action. Fix issue #492
This commit is contained in:
parent
348b952b8c
commit
a51896c81b
@ -60,9 +60,11 @@ object HaskellFileUtil {
|
||||
|
||||
def saveFileAsIsInDispatchThread(project: Project, virtualFile: VirtualFile): Unit = {
|
||||
findDocument(virtualFile).foreach(d => {
|
||||
PsiDocumentManager.getInstance(project).doPostponedOperationsAndUnblockDocument(d)
|
||||
val documentManager = PsiDocumentManager.getInstance(project)
|
||||
val fileDocumentManager = FileDocumentManager.getInstance
|
||||
ApplicationUtil.runReadAction(documentManager.doPostponedOperationsAndUnblockDocument(d))
|
||||
ApplicationManager.getApplication.invokeAndWait(() => {
|
||||
FileDocumentManager.getInstance.saveDocumentAsIs(d)
|
||||
fileDocumentManager.saveDocumentAsIs(d)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user