File tree 2 files changed +12
-0
lines changed
app/src/processing/app/syntax
2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change 30
30
31
31
package processing .app .syntax ;
32
32
33
+ import java .awt .event .InputEvent ;
34
+ import java .awt .event .KeyEvent ;
35
+ import javax .swing .KeyStroke ;
33
36
import org .apache .commons .compress .utils .IOUtils ;
34
37
import org .fife .ui .rsyntaxtextarea .*;
35
38
import org .fife .ui .rsyntaxtextarea .Token ;
56
59
import java .net .URL ;
57
60
import java .util .Map ;
58
61
import java .util .logging .Logger ;
62
+ import processing .app .helpers .OSUtils ;
59
63
60
64
/**
61
65
* Arduino Sketch code editor based on RSyntaxTextArea (http://fifesoft.com/rsyntaxtextarea)
@@ -72,6 +76,7 @@ public class SketchTextArea extends RSyntaxTextArea {
72
76
public SketchTextArea (PdeKeywords pdeKeywords ) throws IOException {
73
77
this .pdeKeywords = pdeKeywords ;
74
78
installFeatures ();
79
+ fixCtrlDeleteBehavior ();
75
80
}
76
81
77
82
public void setKeywords (PdeKeywords keywords ) {
@@ -389,4 +394,10 @@ private void stopScanningForLinks() {
389
394
protected RTextAreaUI createRTextAreaUI () {
390
395
return new SketchTextAreaUI (this );
391
396
}
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
+ }
392
403
}
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ ARDUINO 1.6.9
14
14
* Make http://librarymanager and http://boardmanager links clickable from the editor window
15
15
* Cut/Copy actions are disable when there is no text selected. Thanks @avargas-nearsoft
16
16
* 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
17
18
18
19
[core]
19
20
* 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