diff --git a/app/src/processing/app/Editor.java b/app/src/processing/app/Editor.java index 75cdec6f6..0190693d1 100644 --- a/app/src/processing/app/Editor.java +++ b/app/src/processing/app/Editor.java @@ -1420,7 +1420,8 @@ public class Editor extends JFrame implements RunnerListener { }); menu.add(commentItem); - JMenuItem increaseIndentItem = newJMenuItem(_("Increase Indent"), ']'); + JMenuItem increaseIndentItem = new JMenuItem(_("Increase Indent")); + increaseIndentItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0)); increaseIndentItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { handleIndentOutdent(true); @@ -1428,7 +1429,8 @@ public class Editor extends JFrame implements RunnerListener { }); menu.add(increaseIndentItem); - JMenuItem decreseIndentItem = newJMenuItem(_("Decrease Indent"), '['); + JMenuItem decreseIndentItem = new JMenuItem(_("Decrease Indent")); + decreseIndentItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, InputEvent.SHIFT_MASK)); decreseIndentItem.setName("menuDecreaseIndent"); decreseIndentItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { diff --git a/app/src/processing/app/syntax/SketchTextAreaDefaultInputMap.java b/app/src/processing/app/syntax/SketchTextAreaDefaultInputMap.java index 6957b622a..6a6da5d3a 100644 --- a/app/src/processing/app/syntax/SketchTextAreaDefaultInputMap.java +++ b/app/src/processing/app/syntax/SketchTextAreaDefaultInputMap.java @@ -39,6 +39,9 @@ public class SketchTextAreaDefaultInputMap extends RSyntaxTextAreaDefaultInputMa put(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, defaultModifier), DefaultEditorKit.endAction); remove(KeyStroke.getKeyStroke(KeyEvent.VK_J, defaultModifier)); + + put(KeyStroke.getKeyStroke(KeyEvent.VK_OPEN_BRACKET, defaultModifier), DefaultEditorKit.insertTabAction); + put(KeyStroke.getKeyStroke(KeyEvent.VK_CLOSE_BRACKET, defaultModifier), RSyntaxTextAreaEditorKit.rstaDecreaseIndentAction); } put(KeyStroke.getKeyStroke(KeyEvent.VK_DIVIDE, defaultModifier), RSyntaxTextAreaEditorKit.rstaToggleCommentAction);