mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fixed PY-14284 IPython Notebook: shortcuts scope should depend on the focus for non-code cells
This commit is contained in:
@@ -45,10 +45,10 @@
|
||||
<action class="org.jetbrains.plugins.ipnb.editor.actions.IpnbAddCellAboveAction" id="IpnbAddCellAboveAction" text="Insert Cell Above">
|
||||
<keyboard-shortcut keymap="$default" first-keystroke="ctrl shift EQUALS"/>
|
||||
</action>
|
||||
<action class="org.jetbrains.plugins.ipnb.editor.actions.IpnbCutCellAction" id="IpnbCutCellAction" text="Cut Cell" use-shortcut-of="$Cut"/>
|
||||
<action class="org.jetbrains.plugins.ipnb.editor.actions.IpnbCopyCellAction" id="IpnbCopyCellAction" text="Copy Cell" use-shortcut-of="$Copy"/>
|
||||
<action class="org.jetbrains.plugins.ipnb.editor.actions.IpnbPasteCellAction" id="IpnbPasteCellAction" text="Paste Cell Below" use-shortcut-of="$Paste"/>
|
||||
<action class="org.jetbrains.plugins.ipnb.editor.actions.IpnbDeleteCellAction" id="IpnbDeleteCellAction" text="Delete Cell" use-shortcut-of="$Delete"/>
|
||||
<action class="org.jetbrains.plugins.ipnb.editor.actions.IpnbCutCellAction" id="IpnbCutCellAction" text="Cut Cell"/>
|
||||
<action class="org.jetbrains.plugins.ipnb.editor.actions.IpnbCopyCellAction" id="IpnbCopyCellAction" text="Copy Cell"/>
|
||||
<action class="org.jetbrains.plugins.ipnb.editor.actions.IpnbPasteCellAction" id="IpnbPasteCellAction" text="Paste Cell Below"/>
|
||||
<action class="org.jetbrains.plugins.ipnb.editor.actions.IpnbDeleteCellAction" id="IpnbDeleteCellAction" text="Delete Cell"/>
|
||||
|
||||
<action class="org.jetbrains.plugins.ipnb.editor.actions.IpnbMoveCellDownAction" id="IpnbMoveCellDownAction" text="Move Cell Down">
|
||||
<keyboard-shortcut keymap="$default" first-keystroke="ctrl shift DOWN"/>
|
||||
|
||||
@@ -22,6 +22,7 @@ import org.jetbrains.plugins.ipnb.format.cells.output.IpnbOutputCell;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.InputEvent;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.awt.event.MouseAdapter;
|
||||
import java.awt.event.MouseEvent;
|
||||
@@ -285,6 +286,22 @@ public class IpnbFilePanel extends JPanel implements Scrollable, DataProvider {
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (e.getKeyCode() == KeyEvent.VK_DELETE) {
|
||||
if (!mySelectedCell.isEditing())
|
||||
deleteCell(mySelectedCell);
|
||||
}
|
||||
else if (e.getKeyCode() == KeyEvent.VK_X && e.getModifiers() == InputEvent.CTRL_MASK) {
|
||||
if (!mySelectedCell.isEditing())
|
||||
cutCell();
|
||||
}
|
||||
else if (e.getKeyCode() == KeyEvent.VK_C && e.getModifiers() == InputEvent.CTRL_MASK) {
|
||||
if (!mySelectedCell.isEditing())
|
||||
copyCell();
|
||||
}
|
||||
else if (e.getKeyCode() == KeyEvent.VK_V && e.getModifiers() == InputEvent.CTRL_MASK) {
|
||||
if (!mySelectedCell.isEditing())
|
||||
pasteCell();
|
||||
}
|
||||
else {
|
||||
getParent().dispatchEvent(e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user