mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
more debug output
This commit is contained in:
+10
-1
@@ -25,6 +25,7 @@ import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.EditorFactory;
|
||||
import com.intellij.openapi.editor.LogicalPosition;
|
||||
import com.intellij.openapi.editor.ex.EditorEx;
|
||||
import com.intellij.openapi.editor.highlighter.EditorHighlighter;
|
||||
import com.intellij.openapi.fileEditor.*;
|
||||
import com.intellij.openapi.fileEditor.ex.FileEditorManagerEx;
|
||||
import com.intellij.openapi.fileEditor.impl.text.TextEditorProvider;
|
||||
@@ -390,10 +391,14 @@ import java.util.Map;
|
||||
myActiveFile = file;
|
||||
}
|
||||
|
||||
public boolean debug = false;
|
||||
@Override
|
||||
public Editor openTextEditor(OpenFileDescriptor descriptor, boolean focusEditor) {
|
||||
final VirtualFile file = descriptor.getFile();
|
||||
Editor editor = myVirtualFile2Editor.get(file);
|
||||
if (debug) {
|
||||
System.err.println("Got " + editor + " as editor from cache for " + file);
|
||||
}
|
||||
|
||||
if (editor == null) {
|
||||
PsiFile psiFile = PsiManager.getInstance(myProject).findFile(file);
|
||||
@@ -401,7 +406,11 @@ import java.util.Map;
|
||||
Document document = PsiDocumentManager.getInstance(myProject).getDocument(psiFile);
|
||||
LOG.assertTrue(document != null, psiFile);
|
||||
editor = EditorFactory.getInstance().createEditor(document, myProject);
|
||||
((EditorEx) editor).setHighlighter(HighlighterFactory.createHighlighter(myProject, file));
|
||||
final EditorHighlighter highlighter = HighlighterFactory.createHighlighter(myProject, file);
|
||||
if (debug) {
|
||||
System.err.println("highlighter " + highlighter);
|
||||
}
|
||||
((EditorEx) editor).setHighlighter(highlighter);
|
||||
((EditorEx) editor).setFile(file);
|
||||
|
||||
myVirtualFile2Editor.put(file, editor);
|
||||
|
||||
Reference in New Issue
Block a user