Skip to content

Commit 3efcc9e

Browse files
committed
Change the CTRL+DELETE behavior to restore the next word
1 parent a7ca976 commit 3efcc9e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

app/src/processing/app/syntax/SketchTextArea.java

+9
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030

3131
package processing.app.syntax;
3232

33+
import java.awt.event.KeyEvent;
34+
import javax.swing.KeyStroke;
3335
import org.apache.commons.compress.utils.IOUtils;
3436
import org.fife.ui.rsyntaxtextarea.*;
3537
import org.fife.ui.rsyntaxtextarea.Token;
@@ -72,6 +74,7 @@ public class SketchTextArea extends RSyntaxTextArea {
7274
public SketchTextArea(PdeKeywords pdeKeywords) throws IOException {
7375
this.pdeKeywords = pdeKeywords;
7476
installFeatures();
77+
fixCtrlDeleteBehavior();
7578
}
7679

7780
public void setKeywords(PdeKeywords keywords) {
@@ -389,4 +392,10 @@ private void stopScanningForLinks() {
389392
protected RTextAreaUI createRTextAreaUI() {
390393
return new SketchTextAreaUI(this);
391394
}
395+
396+
private void fixCtrlDeleteBehavior() {
397+
KeyStroke keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_DELETE,
398+
Toolkit.getDefaultToolkit().getMenuShortcutKeyMask());
399+
getInputMap().put(keyStroke, SketchTextAreaEditorKit.rtaDeleteNextWordAction);
400+
}
392401
}

0 commit comments

Comments
 (0)