mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fixed PY-14342 IPython Notebook run cell shortcuts don't work when the cell is in edit mode
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
package org.jetbrains.plugins.ipnb.editor.panels.code;
|
||||
|
||||
import com.intellij.openapi.Disposable;
|
||||
import com.intellij.openapi.actionSystem.CustomShortcutSet;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.EditorFactory;
|
||||
import com.intellij.openapi.project.Project;
|
||||
@@ -24,7 +25,9 @@ import com.intellij.ui.Gray;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.plugins.ipnb.editor.IpnbEditorUtil;
|
||||
import org.jetbrains.plugins.ipnb.editor.actions.IpnbRunCellAction;
|
||||
import org.jetbrains.plugins.ipnb.editor.actions.IpnbRunCellBaseAction;
|
||||
import org.jetbrains.plugins.ipnb.editor.actions.IpnbRunCellInplaceAction;
|
||||
import org.jetbrains.plugins.ipnb.editor.panels.IpnbEditorPanel;
|
||||
import org.jetbrains.plugins.ipnb.editor.panels.IpnbFilePanel;
|
||||
import org.jetbrains.plugins.ipnb.editor.panels.IpnbPanel;
|
||||
@@ -83,6 +86,9 @@ public class IpnbCodeSourcePanel extends IpnbPanel<JComponent, IpnbCodeCell> imp
|
||||
final JComponent component = myEditor.getComponent();
|
||||
final JComponent contentComponent = myEditor.getContentComponent();
|
||||
|
||||
new IpnbRunCellAction().registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke("shift ENTER")), contentComponent);
|
||||
new IpnbRunCellInplaceAction().registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke("ctrl ENTER")), contentComponent);
|
||||
|
||||
contentComponent.addKeyListener(new KeyAdapter() {
|
||||
@Override
|
||||
public void keyReleased(KeyEvent e) {
|
||||
|
||||
Reference in New Issue
Block a user