1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-12-01 12:24:14 +01:00
This commit is contained in:
Cristian Maglie 2016-04-07 11:27:18 +02:00
commit 60b169fbe9
2 changed files with 12 additions and 0 deletions

View File

@ -30,6 +30,9 @@
package processing.app.syntax;
import java.awt.event.InputEvent;
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;
@ -56,6 +59,7 @@ import java.net.MalformedURLException;
import java.net.URL;
import java.util.Map;
import java.util.logging.Logger;
import processing.app.helpers.OSUtils;
/**
* Arduino Sketch code editor based on RSyntaxTextArea (http://fifesoft.com/rsyntaxtextarea)
@ -72,6 +76,7 @@ public class SketchTextArea extends RSyntaxTextArea {
public SketchTextArea(PdeKeywords pdeKeywords) throws IOException {
this.pdeKeywords = pdeKeywords;
installFeatures();
fixCtrlDeleteBehavior();
}
public void setKeywords(PdeKeywords keywords) {
@ -389,4 +394,10 @@ public class SketchTextArea extends RSyntaxTextArea {
protected RTextAreaUI createRTextAreaUI() {
return new SketchTextAreaUI(this);
}
private void fixCtrlDeleteBehavior() {
int modifier = OSUtils.isMacOS()? InputEvent.ALT_MASK : InputEvent.CTRL_MASK;
KeyStroke keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, modifier);
getInputMap().put(keyStroke, SketchTextAreaEditorKit.rtaDeleteNextWordAction);
}
}

View File

@ -14,6 +14,7 @@ ARDUINO 1.6.9
* Make http://librarymanager and http://boardmanager links clickable from the editor window
* Cut/Copy actions are disable when there is no text selected. Thanks @avargas-nearsoft
* Added more OSX native (emacs-like) keybindings. Thanks @nopdotcom
* Fixed Ctrl+Del: now deletes the word behind the cursor instead of the entire line. Thanks @avargas-nearsoft
[core]
* sam: Allow 3rd party boards that depend on SAM core to use their own