Project View: do not freeze on large files in split mode with Structure

This commit is contained in:
Gregory.Shrago
2013-10-23 21:23:06 +04:00
parent 1378c06c33
commit 72ddd041df
@@ -39,6 +39,7 @@ import com.intellij.openapi.util.Comparing;
import com.intellij.openapi.util.Disposer;
import com.intellij.openapi.util.Pair;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.vfs.PersistentFSConstants;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.openapi.wm.IdeFocusManager;
import com.intellij.openapi.wm.ToolWindow;
@@ -391,6 +392,8 @@ public class StructureViewWrapperImpl implements StructureViewWrapper, Disposabl
@Nullable
private FileEditor createTempFileEditor(VirtualFile file) {
if (file.getLength() > PersistentFSConstants.getMaxIntellisenseFileSize()) return null;
FileEditorProviderManager editorProviderManager = FileEditorProviderManager.getInstance();
final FileEditorProvider[] providers = editorProviderManager.getProviders(myProject, file);
for (FileEditorProvider provider : providers) {