Skip to content

Commit 9b311fc

Browse files
committed
RLangInputHandler.java: Add RLangInputHandler
Fix #8 Signed-off-by: Ce Gao <[email protected]>
1 parent fe1bfd9 commit 9b311fc

File tree

2 files changed

+417
-2
lines changed

2 files changed

+417
-2
lines changed

src/rprocessing/mode/RLangEditor.java

+9-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import java.io.IOException;
1010
import java.nio.file.Files;
1111
import java.nio.file.Path;
12-
import java.util.Properties;
1312
import java.util.UUID;
1413

1514
import javax.swing.AbstractAction;
@@ -25,6 +24,8 @@
2524
import processing.app.Platform;
2625
import processing.app.SketchCode;
2726
import processing.app.SketchException;
27+
import processing.app.syntax.JEditTextArea;
28+
import processing.app.syntax.PdeTextAreaDefaults;
2829
import processing.app.ui.Editor;
2930
import processing.app.ui.EditorException;
3031
import processing.app.ui.EditorState;
@@ -45,7 +46,8 @@
4546
*/
4647
public class RLangEditor extends Editor {
4748

48-
private static final boolean VERBOSE = Boolean.parseBoolean(System.getenv("VERBOSE_RLANG_MODE"));
49+
private static final boolean VERBOSE = Boolean
50+
.parseBoolean(System.getenv("VERBOSE_RLANG_MODE"));
4951

5052
private static void log(final String msg) {
5153
if (VERBOSE) {
@@ -185,6 +187,11 @@ public Formatter createFormatter() {
185187
return null;
186188
}
187189

190+
@Override
191+
protected JEditTextArea createTextArea() {
192+
return new JEditTextArea(new PdeTextAreaDefaults(mode), new RLangInputHandler(this));
193+
}
194+
188195
/**
189196
* @see processing.app.ui.Editor#createToolbar()
190197
*/

0 commit comments

Comments
 (0)