File tree Expand file tree Collapse file tree 4 files changed +23
-12
lines changed
java/src/processing/mode/java Expand file tree Collapse file tree 4 files changed +23
-12
lines changed Original file line number Diff line number Diff line change 3030
3131import processing .app .Platform ;
3232import processing .app .Preferences ;
33+ import processing .app .ui .Editor ;
3334
3435
3536/**
3940 */
4041public class PdeInputHandler extends DefaultInputHandler {
4142
42- public PdeInputHandler () {
43+ /**
44+ * Need the Editor object for Input Method changes, plus most subclasses
45+ * will want a local copy anyway. Changed after Processing 3.1.2, need to
46+ * see if this breaks any other Modes before releasing.
47+ */
48+ protected Editor editor ;
49+
50+
51+ public PdeInputHandler (Editor editor ) {
52+ this .editor = editor ;
53+
4354 // Use option on mac for text edit controls that are ctrl on Windows/Linux.
4455 // (i.e. ctrl-left/right is option-left/right on OS X)
4556 String mod = Platform .isMacOS () ? "A" : "C" ;
@@ -253,4 +264,9 @@ public boolean handlePressed(KeyEvent event) {
253264 public boolean handleTyped (KeyEvent event ) {
254265 return false ;
255266 }
267+
268+
269+ public void handleInputMethodCommit () {
270+ editor .getSketch ().setModified (true );
271+ }
256272}
Original file line number Diff line number Diff line change @@ -389,7 +389,7 @@ public void removeToolContrib(ToolContribution tc) {
389389
390390 protected JEditTextArea createTextArea () {
391391 return new JEditTextArea (new PdeTextAreaDefaults (mode ),
392- new PdeInputHandler ());
392+ new PdeInputHandler (this ));
393393 }
394394
395395
@@ -1770,7 +1770,7 @@ public void beginCompoundEdit() {
17701770 startCompoundEdit ();
17711771 super .beginCompoundEdit ();
17721772 }
1773-
1773+
17741774 @ Override
17751775 public void endCompoundEdit () {
17761776 stopCompoundEdit ();
@@ -1805,7 +1805,7 @@ public void insertUpdate(DocumentEvent e) {
18051805 if (!isInserting && !textarea .isOverwriteEnabled () && isDirectEdit ()) {
18061806 endTextEditHistory ();
18071807 }
1808-
1808+
18091809 if (!textarea .isOverwriteEnabled ()) {
18101810 isInserting = true ;
18111811 }
Original file line number Diff line number Diff line change 4040 * continuing to hack this class.
4141 */
4242public class JavaInputHandler extends PdeInputHandler {
43- private Editor editor ;
4443
4544 /** ctrl-alt on windows and linux, cmd-alt on mac os x */
4645 static final int CTRL_ALT = ActionEvent .ALT_MASK |
4746 Toolkit .getDefaultToolkit ().getMenuShortcutKeyMask ();
4847
4948
5049 public JavaInputHandler (Editor editor ) {
51- this . editor = editor ;
50+ super ( editor ) ;
5251 }
5352
5453
@@ -334,12 +333,6 @@ public boolean handleTyped(KeyEvent event) {
334333 }
335334
336335
337- @ Override
338- public void handleInputMethodCommit () {
339- editor .getSketch ().setModified (true );
340- }
341-
342-
343336 /**
344337 * Return the index for the first character on this line.
345338 */
Original file line number Diff line number Diff line change 110252 (3.1.3?)
2+ X change PdeInputHandler constructor
3+ _ check whether this breaks other Modes before releasing
24_ modify line number color when no lines extend that far?
35_ https://github.com/processing/processing/pull/4560
46_ text gutter doesn't seem to be hidpi
You can’t perform that action at this time.
0 commit comments