mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
avoid exception when disabling new rendering and closing existing open editor
This commit is contained in:
+3
@@ -21,6 +21,7 @@ import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.editor.*;
|
||||
import com.intellij.openapi.editor.ex.util.EditorUtil;
|
||||
import com.intellij.openapi.editor.impl.EditorImpl;
|
||||
import com.intellij.openapi.fileEditor.*;
|
||||
import com.intellij.openapi.fileEditor.ex.FileEditorManagerEx;
|
||||
import com.intellij.openapi.fileTypes.BinaryFileTypeDecompilers;
|
||||
@@ -31,6 +32,7 @@ import com.intellij.openapi.project.ProjectManager;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.openapi.util.Key;
|
||||
import com.intellij.openapi.util.UserDataHolderBase;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.pom.Navigatable;
|
||||
import com.intellij.psi.SingleRootFileViewProvider;
|
||||
@@ -207,6 +209,7 @@ public class TextEditorProvider implements FileEditorProvider, DumbAware {
|
||||
|
||||
protected TextEditorState getStateImpl(final Project project, @NotNull Editor editor, @NotNull FileEditorStateLevel level){
|
||||
TextEditorState state = new TextEditorState();
|
||||
if (!Registry.is("editor.new.rendering") && editor instanceof EditorImpl && ((EditorImpl)editor).myUseNewRendering) return state;
|
||||
CaretModel caretModel = editor.getCaretModel();
|
||||
if (caretModel.supportsMultipleCarets()) {
|
||||
List<CaretState> caretsAndSelections = caretModel.getCaretsAndSelections();
|
||||
|
||||
Reference in New Issue
Block a user