mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
make sure CARET value exists in editor's data context even if editor is not associated with any project
This commit is contained in:
+6
-9
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
* Copyright 2000-2016 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -30,10 +30,7 @@ import com.intellij.openapi.command.CommandProcessor;
|
||||
import com.intellij.openapi.command.UndoConfirmationPolicy;
|
||||
import com.intellij.openapi.editor.Caret;
|
||||
import com.intellij.openapi.editor.Document;
|
||||
import com.intellij.openapi.editor.DocumentRunnable;
|
||||
import com.intellij.openapi.editor.LogicalPosition;
|
||||
import com.intellij.openapi.editor.ReadOnlyFragmentModificationException;
|
||||
import com.intellij.openapi.editor.VisualPosition;
|
||||
import com.intellij.openapi.editor.*;
|
||||
import com.intellij.openapi.editor.actionSystem.EditorActionManager;
|
||||
import com.intellij.openapi.editor.actions.EditorActionUtil;
|
||||
import com.intellij.openapi.editor.colors.EditorColorsManager;
|
||||
@@ -42,7 +39,6 @@ import com.intellij.openapi.editor.event.CaretListener;
|
||||
import com.intellij.openapi.editor.event.DocumentEvent;
|
||||
import com.intellij.openapi.editor.event.DocumentListener;
|
||||
import com.intellij.openapi.editor.ex.DocumentEx;
|
||||
import com.intellij.openapi.editor.event.DocumentListener;
|
||||
import com.intellij.openapi.editor.ex.util.EditorUIUtil;
|
||||
import com.intellij.openapi.editor.ex.util.EditorUtil;
|
||||
import com.intellij.openapi.fileEditor.FileDocumentManager;
|
||||
@@ -51,7 +47,6 @@ import com.intellij.openapi.ui.Queryable;
|
||||
import com.intellij.openapi.ui.TypingTarget;
|
||||
import com.intellij.openapi.util.*;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.openapi.util.TextRange;
|
||||
import com.intellij.openapi.wm.impl.IdeBackgroundUtil;
|
||||
import com.intellij.ui.EditorTextField;
|
||||
import com.intellij.ui.Grayer;
|
||||
@@ -61,16 +56,15 @@ import org.intellij.lang.annotations.MagicConstant;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.accessibility.*;
|
||||
import javax.swing.*;
|
||||
import javax.swing.event.ChangeListener;
|
||||
import javax.swing.event.UndoableEditListener;
|
||||
import javax.swing.plaf.TextUI;
|
||||
import javax.swing.text.*;
|
||||
import javax.swing.text.AttributeSet;
|
||||
import javax.swing.text.Segment;
|
||||
import java.awt.*;
|
||||
import java.awt.event.ComponentAdapter;
|
||||
import java.awt.event.*;
|
||||
import java.awt.im.InputMethodRequests;
|
||||
import java.util.ArrayList;
|
||||
@@ -136,6 +130,9 @@ public class EditorComponentImpl extends JTextComponent implements Scrollable, D
|
||||
// for 'big' editors return null to allow injected editors (see com.intellij.openapi.fileEditor.impl.text.TextEditorComponent.getData())
|
||||
return myEditor.getVirtualFile() == null ? myEditor : null;
|
||||
}
|
||||
if (CommonDataKeys.CARET.is(dataId)) {
|
||||
return myEditor.getCaretModel().getCurrentCaret();
|
||||
}
|
||||
if (PlatformDataKeys.DELETE_ELEMENT_PROVIDER.is(dataId)) {
|
||||
return myEditor.getDeleteProvider();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user