@@ -1637,19 +1637,19 @@ public int getScrollPosition() {
1637
1637
* Switch between tabs, this swaps out the Document object
1638
1638
* that's currently being manipulated.
1639
1639
*/
1640
- protected void setCode (SketchCode code ) {
1641
- SyntaxDocument document = (SyntaxDocument ) code .getDocument ();
1640
+ protected void setCode (SketchCodeDoc codeDoc ) {
1641
+ SyntaxDocument document = (SyntaxDocument ) codeDoc .getDocument ();
1642
1642
1643
1643
if (document == null ) { // this document not yet inited
1644
1644
document = new SyntaxDocument ();
1645
- code .setDocument (document );
1646
-
1645
+ codeDoc .setDocument (document );
1646
+
1647
1647
// turn on syntax highlighting
1648
1648
document .setTokenMarker (new PdeKeywords ());
1649
1649
1650
1650
// insert the program text into the document object
1651
1651
try {
1652
- document .insertString (0 , code .getProgram (), null );
1652
+ document .insertString (0 , codeDoc . getCode () .getProgram (), null );
1653
1653
} catch (BadLocationException bl ) {
1654
1654
bl .printStackTrace ();
1655
1655
}
@@ -1674,12 +1674,12 @@ public void undoableEditHappened(UndoableEditEvent e) {
1674
1674
1675
1675
// update the document object that's in use
1676
1676
textarea .setDocument (document ,
1677
- code .getSelectionStart (), code .getSelectionStop (),
1678
- code .getScrollPosition ());
1677
+ codeDoc .getSelectionStart (), codeDoc .getSelectionStop (),
1678
+ codeDoc .getScrollPosition ());
1679
1679
1680
1680
textarea .requestFocus (); // get the caret blinking
1681
1681
1682
- this .undo = code .getUndo ();
1682
+ this .undo = codeDoc .getUndo ();
1683
1683
undoAction .updateUndoState ();
1684
1684
redoAction .updateRedoState ();
1685
1685
}
0 commit comments