File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
app/src/processing/app/syntax Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change 3030
3131package processing .app .syntax ;
3232
33+ import java .awt .event .InputEvent ;
34+ import java .awt .event .KeyEvent ;
35+ import javax .swing .KeyStroke ;
3336import org .apache .commons .compress .utils .IOUtils ;
3437import org .fife .ui .rsyntaxtextarea .*;
3538import org .fife .ui .rsyntaxtextarea .Token ;
5659import java .net .URL ;
5760import java .util .Map ;
5861import java .util .logging .Logger ;
62+ import processing .app .helpers .OSUtils ;
5963
6064/**
6165 * Arduino Sketch code editor based on RSyntaxTextArea (http://fifesoft.com/rsyntaxtextarea)
@@ -72,6 +76,7 @@ public class SketchTextArea extends RSyntaxTextArea {
7276 public SketchTextArea (PdeKeywords pdeKeywords ) throws IOException {
7377 this .pdeKeywords = pdeKeywords ;
7478 installFeatures ();
79+ fixCtrlDeleteBehavior ();
7580 }
7681
7782 public void setKeywords (PdeKeywords keywords ) {
@@ -389,4 +394,10 @@ private void stopScanningForLinks() {
389394 protected RTextAreaUI createRTextAreaUI () {
390395 return new SketchTextAreaUI (this );
391396 }
397+
398+ private void fixCtrlDeleteBehavior () {
399+ int modifier = OSUtils .isMacOS ()? InputEvent .ALT_MASK : InputEvent .CTRL_MASK ;
400+ KeyStroke keyStroke = KeyStroke .getKeyStroke (KeyEvent .VK_DELETE , modifier );
401+ getInputMap ().put (keyStroke , SketchTextAreaEditorKit .rtaDeleteNextWordAction );
402+ }
392403}
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ ARDUINO 1.6.9
1414* Make http://librarymanager and http://boardmanager links clickable from the editor window
1515* Cut/Copy actions are disable when there is no text selected. Thanks @avargas-nearsoft
1616* Added more OSX native (emacs-like) keybindings. Thanks @nopdotcom
17+ * Fixed Ctrl+Del: now deletes the word behind the cursor instead of the entire line. Thanks @avargas-nearsoft
1718
1819[core]
1920* sam: Allow 3rd party boards that depend on SAM core to use their own
You can’t perform that action at this time.
0 commit comments