mirror of
https://github.com/arduino/Arduino.git
synced 2025-01-17 06:52:18 +01:00
New editor: ALT+ UP/DOWN move current line only if "editor.advanced" (hidden pref) is true. Fixes #3101
This commit is contained in:
parent
2d24d074e3
commit
91da999cb0
@ -1,15 +1,27 @@
|
|||||||
package processing.app.syntax;
|
package processing.app.syntax;
|
||||||
|
|
||||||
import org.fife.ui.rsyntaxtextarea.RSyntaxTextAreaDefaultInputMap;
|
import org.fife.ui.rsyntaxtextarea.RSyntaxTextAreaDefaultInputMap;
|
||||||
|
import org.fife.ui.rtextarea.RTextAreaEditorKit;
|
||||||
|
import processing.app.PreferencesData;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
import java.awt.event.InputEvent;
|
||||||
import java.awt.event.KeyEvent;
|
import java.awt.event.KeyEvent;
|
||||||
|
|
||||||
public class SketchTextAreaDefaultInputMap extends RSyntaxTextAreaDefaultInputMap {
|
public class SketchTextAreaDefaultInputMap extends RSyntaxTextAreaDefaultInputMap {
|
||||||
|
|
||||||
public SketchTextAreaDefaultInputMap() {
|
public SketchTextAreaDefaultInputMap() {
|
||||||
int defaultMod = getDefaultModifier();
|
int defaultMod = getDefaultModifier();
|
||||||
|
int alt = InputEvent.ALT_MASK;
|
||||||
|
|
||||||
remove(KeyStroke.getKeyStroke(KeyEvent.VK_K, defaultMod));
|
remove(KeyStroke.getKeyStroke(KeyEvent.VK_K, defaultMod));
|
||||||
|
|
||||||
|
if (PreferencesData.getBoolean("editor.advanced")) {
|
||||||
|
put(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, alt), RTextAreaEditorKit.rtaLineDownAction);
|
||||||
|
put(KeyStroke.getKeyStroke(KeyEvent.VK_UP, alt), RTextAreaEditorKit.rtaLineUpAction);
|
||||||
|
} else {
|
||||||
|
remove(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, alt));
|
||||||
|
remove(KeyStroke.getKeyStroke(KeyEvent.VK_UP, alt));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user