41
41
import processing .app .helpers .OSUtils ;
42
42
import processing .app .helpers .PreferencesMapException ;
43
43
import processing .app .legacy .PApplet ;
44
- import processing .app .syntax .PdeKeywords ;
45
44
import processing .app .syntax .ArduinoTokenMakerFactory ;
45
+ import processing .app .syntax .PdeKeywords ;
46
46
import processing .app .syntax .SketchTextArea ;
47
47
import processing .app .tools .DiscourseFormat ;
48
48
import processing .app .tools .MenuScroller ;
@@ -2006,7 +2006,7 @@ public BuildHandler(boolean verbose, boolean saveHex) {
2006
2006
@ Override
2007
2007
public void run () {
2008
2008
try {
2009
- textarea . removeAllLineHighlights ();
2009
+ removeAllLineHighlights ();
2010
2010
sketch .prepare ();
2011
2011
sketch .build (verbose , saveHex );
2012
2012
statusNotice (tr ("Done compiling." ));
@@ -2024,6 +2024,15 @@ public void run() {
2024
2024
}
2025
2025
}
2026
2026
2027
+ public void removeAllLineHighlights () {
2028
+ textarea .removeAllLineHighlights ();
2029
+ }
2030
+
2031
+ public void addLineHighlight (int line ) throws BadLocationException {
2032
+ textarea .addLineHighlight (line , new Color (1 , 0 , 0 , 0.2f ));
2033
+ textarea .setCaretPosition (textarea .getLineStartOffset (line ));
2034
+ }
2035
+
2027
2036
private class DefaultStopHandler implements Runnable {
2028
2037
public void run () {
2029
2038
// TODO
@@ -2276,7 +2285,7 @@ private void updateTitle() {
2276
2285
public boolean handleSave (boolean immediately ) {
2277
2286
//stopRunner();
2278
2287
handleStop (); // 0136
2279
- textarea . removeAllLineHighlights ();
2288
+ removeAllLineHighlights ();
2280
2289
2281
2290
if (untitled ) {
2282
2291
return handleSaveAs ();
@@ -2430,7 +2439,7 @@ class DefaultExportHandler implements Runnable {
2430
2439
public void run () {
2431
2440
2432
2441
try {
2433
- textarea . removeAllLineHighlights ();
2442
+ removeAllLineHighlights ();
2434
2443
if (serialMonitor != null ) {
2435
2444
serialMonitor .suspend ();
2436
2445
}
@@ -2876,8 +2885,7 @@ public void statusError(Exception e) {
2876
2885
System .err .println (I18n .format (tr ("Bad error line: {0}" ), line ));
2877
2886
} else {
2878
2887
try {
2879
- textarea .addLineHighlight (line , new Color (1 , 0 , 0 , 0.2f ));
2880
- textarea .setCaretPosition (textarea .getLineStartOffset (line ));
2888
+ addLineHighlight (line );
2881
2889
} catch (BadLocationException e1 ) {
2882
2890
e1 .printStackTrace ();
2883
2891
}
0 commit comments