mirror of
https://github.com/arduino/Arduino.git
synced 2025-01-17 06:52:18 +01:00
Stop using [ and ] as indentation menu accelerators. Use TAB/SHIFT+TAB instead. CMD+BRAKETS are still available on MacOSX only
Fixes #3224 and #220 Also see https://github.com/processing/processing/issues/2199
This commit is contained in:
parent
5490b96f2e
commit
4bf40fc23b
@ -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) {
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user