com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil



API Populatity

3 Client projects

Project: com.intellij

Package: com.intellij.psi

Project JetBrains/ideavim in file ...ea.vim.action.change.insert.InsertEnterAction.java (2012-02-16)
@@ -23,6 +23,7 @@ import com.intellij.openapi.actionSystem.DataContext;
 import com.intellij.openapi.editor.Editor;
 import com.intellij.openapi.editor.actionSystem.EditorAction;
 import com.intellij.openapi.editor.actionSystem.EditorActionHandler;
+import com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil;
 import com.maddyhome.idea.vim.group.CommandGroups;
 
 /**
@@ -34,6 +35,7 @@ public class InsertEnterAction extends EditorAction {
 
   private static class Handler extends EditorActionHandler {
     public void execute(Editor editor, DataContext context) {
+      editor = InjectedLanguageUtil.getTopLevelEditor(editor);
       if (editor.isOneLineMode()) {
         return;
       }
Project JetBrains/ideavim in file ....idea.vim.handler.AbstractEditorActionHandler.java (2012-02-16)
@@ -23,6 +23,7 @@ import com.intellij.openapi.actionSystem.DataContext;
 import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.editor.Editor;
 import com.intellij.openapi.editor.actionSystem.EditorActionHandler;
+import com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil;
 import com.maddyhome.idea.vim.KeyHandler;
 import com.maddyhome.idea.vim.VimPlugin;
 import com.maddyhome.idea.vim.command.Command;
@@ -32,6 +33,7 @@ import com.maddyhome.idea.vim.command.CommandState;
  */
 public abstract class AbstractEditorActionHandler extends EditorActionHandler {
   public final void execute(Editor editor, DataContext context) {
+    editor = InjectedLanguageUtil.getTopLevelEditor(editor);
     logger.debug("execute");
     if ((editor == null || !VimPlugin.isEnabled()) && this instanceof DelegateActionHandler) {
       KeyHandler.executeAction(((DelegateActionHandler)this).getOrigAction(), context);
Project JetBrains/ideavim in file ....idea.vim.action.PassThruDelegateEditorAction.java (2012-02-16)
@@ -23,6 +23,7 @@ import com.intellij.openapi.actionSystem.DataContext;
 import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.editor.Editor;
 import com.intellij.openapi.editor.actionSystem.EditorActionHandler;
+import com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil;
 import com.maddyhome.idea.vim.KeyHandler;
 import com.maddyhome.idea.vim.VimPlugin;
 
@@ -52,7 +53,7 @@ public class PassThruDelegateEditorAction extends AbstractDelegateEditorAction {
         if (logger.isDebugEnabled()) {
           logger.debug("event = KeyEvent: " + stroke);
         }
-        KeyHandler.getInstance().handleKey(editor, stroke, dataContext);
+        KeyHandler.getInstance().handleKey(InjectedLanguageUtil.getTopLevelEditor(editor), stroke, dataContext);
       }
     }