1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-11-29 10:24:12 +01:00

Change the CTRL+DELETE behavior to restore the next word

This commit is contained in:
Arturo Vargas 2016-04-04 14:42:40 -07:00
parent a7ca976623
commit 3efcc9ec48

View File

@ -30,6 +30,8 @@
package processing.app.syntax;
import java.awt.event.KeyEvent;
import javax.swing.KeyStroke;
import org.apache.commons.compress.utils.IOUtils;
import org.fife.ui.rsyntaxtextarea.*;
import org.fife.ui.rsyntaxtextarea.Token;
@ -72,6 +74,7 @@ public class SketchTextArea extends RSyntaxTextArea {
public SketchTextArea(PdeKeywords pdeKeywords) throws IOException {
this.pdeKeywords = pdeKeywords;
installFeatures();
fixCtrlDeleteBehavior();
}
public void setKeywords(PdeKeywords keywords) {
@ -389,4 +392,10 @@ public class SketchTextArea extends RSyntaxTextArea {
protected RTextAreaUI createRTextAreaUI() {
return new SketchTextAreaUI(this);
}
private void fixCtrlDeleteBehavior() {
KeyStroke keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_DELETE,
Toolkit.getDefaultToolkit().getMenuShortcutKeyMask());
getInputMap().put(keyStroke, SketchTextAreaEditorKit.rtaDeleteNextWordAction);
}
}