mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
avoid calling getFileType on before content change unless absolutely necessary (IDEA-133507)
This commit is contained in:
+2
-1
@@ -748,7 +748,8 @@ public class FileDocumentManagerImpl extends FileDocumentManager implements Virt
|
||||
@Override
|
||||
public void beforeContentsChange(@NotNull VirtualFileEvent event) {
|
||||
VirtualFile virtualFile = event.getFile();
|
||||
if (virtualFile.getFileType() == UnknownFileType.INSTANCE && virtualFile.getLength() == 0) {
|
||||
// check file type in second order to avoid content detection running
|
||||
if (virtualFile.getLength() == 0 && virtualFile.getFileType() == UnknownFileType.INSTANCE) {
|
||||
virtualFile.putUserData(MUST_RECOMPUTE_FILE_TYPE, Boolean.TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user