1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-01-17 06:52:18 +01:00

Merge pull request #3229 from ffissore/indent-with-tab-no-brackets

Stop using [ and ] as indentation menu accelerators
This commit is contained in:
Federico Fissore 2015-05-29 11:35:07 +02:00
commit 7d6518f68e
2 changed files with 7 additions and 2 deletions

View File

@ -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) {

View File

@ -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);