diff --git a/README.md b/README.md index 55aaa792a..c01b621bd 100644 --- a/README.md +++ b/README.md @@ -19,8 +19,7 @@ The [processing-web](https://github.com/processing/processing-web/) repository contains reference, examples, and the site. (Please use that link to file issues regarding the web site, the examples, or the reference.) -The instructions for building the source [are here](https://github.com/processing/processing/wiki/Build-Instructions), -although they [need an update](https://github.com/processing/processing/issues/1629). +The instructions for building the source [are here](https://github.com/processing/processing/wiki/Build-Instructions). Someday we'll also write code style guidelines, fix all these bugs, throw together hundreds of unit tests, and solve the Israeli-Palestinian conflict. diff --git a/app/src/processing/app/Base.java b/app/src/processing/app/Base.java index 50230531b..322392e98 100644 --- a/app/src/processing/app/Base.java +++ b/app/src/processing/app/Base.java @@ -46,9 +46,9 @@ import processing.core.*; public class Base { // Added accessors for 0218 because the UpdateCheck class was not properly // updating the values, due to javac inlining the static final values. - static private final int REVISION = 224; + static private final int REVISION = 225; /** This might be replaced by main() if there's a lib/version.txt file. */ - static private String VERSION_NAME = "0224"; //$NON-NLS-1$ + static private String VERSION_NAME = "0225"; //$NON-NLS-1$ /** Set true if this a proper release rather than a numbered revision. */ // static private boolean RELEASE = false; diff --git a/app/src/processing/app/FindReplace.java b/app/src/processing/app/FindReplace.java index 922bcc9ba..57c851dd7 100644 --- a/app/src/processing/app/FindReplace.java +++ b/app/src/processing/app/FindReplace.java @@ -454,9 +454,22 @@ public class FindReplace extends JFrame { editor.setSelection(0, 0); boolean foundAtLeastOne = false; - while (true) { + int startTab = -1, startIndex = -1, c = 50000; + // you couldn't seriously be replacing 50K times o_O + while (--c > 0) { if (find(false, false)) { - foundAtLeastOne = true; + if(editor.getSketch().getCurrentCodeIndex() == startTab + && editor.getSelectionStart() == startIndex){ + // we've reached where we started, so stop the replace + Toolkit.beep(); + editor.statusNotice("Reached beginning of search!"); + break; + } + if(!foundAtLeastOne){ + foundAtLeastOne = true; + startTab = editor.getSketch().getCurrentCodeIndex(); + startIndex = editor.getSelectionStart(); + } replace(); } else { break; diff --git a/app/src/processing/app/syntax/Brackets.java b/app/src/processing/app/syntax/Brackets.java index c35e9c359..1fd46ec27 100644 --- a/app/src/processing/app/syntax/Brackets.java +++ b/app/src/processing/app/syntax/Brackets.java @@ -90,7 +90,7 @@ public class Brackets { readComment(text); } else if (d == '*') { readMLComment(text); - } + } else pos--; // Go back because there isn't a comment. } else if (c == '"' || c == '\'') { readString(text, c); } else if (c == '{' || c == '[' || c == '(' || c == '}' || c == ']' diff --git a/app/src/processing/app/syntax/JEditTextArea.java b/app/src/processing/app/syntax/JEditTextArea.java index bc5bb0ed3..60bfad38a 100644 --- a/app/src/processing/app/syntax/JEditTextArea.java +++ b/app/src/processing/app/syntax/JEditTextArea.java @@ -2384,9 +2384,22 @@ public class JEditTextArea extends JComponent return; } - if (event.isPopupTrigger() && (popup != null)) { + // isPopupTrigger() is handled differently across platforms, + // so it may fire during release, or during the press. + // http://docs.oracle.com/javase/7/docs/api/java/awt/event/MouseEvent.html#isPopupTrigger() + // However, we have to exit out of this method if it's a right-click + // anyway, because otherwise it'll de-select the current word. + // As a result, better to just check for BUTTON3 now, indicating that + // isPopupTrigger() is going to fire on the release anyway. + boolean windowsRightClick = + Base.isWindows() && (event.getButton() == MouseEvent.BUTTON3); + if ((event.isPopupTrigger() || windowsRightClick) && (popup != null)) { +// // Windows fires the popup trigger on release (see mouseReleased() below)( +// if (!Base.isWindows()) { +// if (event.isPopupTrigger() && (popup != null)) { popup.show(painter, event.getX(), event.getY()); return; +// } } int line = yToLine(event.getY()); @@ -2423,6 +2436,7 @@ public class JEditTextArea extends JComponent } + /* // Because isPopupTrigger() is handled differently across platforms, // it may fire during release, or during the press. // http://docs.oracle.com/javase/7/docs/api/java/awt/event/MouseEvent.html#isPopupTrigger() @@ -2431,6 +2445,7 @@ public class JEditTextArea extends JComponent popup.show(painter, event.getX(), event.getY()); } } + */ private void doSingleClick(MouseEvent evt, int line, int offset, int dot) { diff --git a/app/src/processing/app/syntax/TextAreaPainter.java b/app/src/processing/app/syntax/TextAreaPainter.java index d1679ddaa..8bafb1d4e 100644 --- a/app/src/processing/app/syntax/TextAreaPainter.java +++ b/app/src/processing/app/syntax/TextAreaPainter.java @@ -564,7 +564,7 @@ public class TextAreaPainter extends JComponent implements TabExpander { /** Returns next tab stop after a specified point. */ -// TabExpander tabExpander = new TabExpander() { +// TabExpander tabExpander = new TabExpander() { @Override public float nextTabStop(float x, int tabOffset) { int offset = textArea.getHorizontalOffset(); @@ -572,7 +572,13 @@ public class TextAreaPainter extends JComponent implements TabExpander { return (ntabs + 1) * tabSize + offset; } // }; - + + + // do we go here? do will kill tabs? +// public float nextTabStop(float x, int tabOffset) { +// return x; +// } + public Dimension getPreferredSize() { return new Dimension(fm.charWidth('w') * defaults.cols, diff --git a/app/src/processing/mode/java/Commander.java b/app/src/processing/mode/java/Commander.java index ba0d83cd6..0fe68c48c 100644 --- a/app/src/processing/mode/java/Commander.java +++ b/app/src/processing/mode/java/Commander.java @@ -48,7 +48,7 @@ public class Commander implements RunnerListener { static final String forceArg = "--force"; static final String outputArg = "--output="; static final String exportApplicationArg = "--export"; - static final String noJavaArg = "--export"; + static final String noJavaArg = "--no-java"; static final String platformArg = "--platform="; static final String bitsArg = "--bits="; // static final String preferencesArg = "--preferences="; @@ -62,19 +62,19 @@ public class Commander implements RunnerListener { static final int EXPORT = 4; Sketch sketch; - + PrintStream systemOut; PrintStream systemErr; - static public void main(String[] args) { + static public void main(String[] args) { // Do this early so that error messages go to the console Base.setCommandLine(); // init the platform so that prefs and other native code is ready to go Base.initPlatform(); // make sure a full JDK is installed Base.initRequirements(); - + // launch command line handler new Commander(args); } @@ -93,22 +93,22 @@ public class Commander implements RunnerListener { // int platformBits = 0; int platformBits = Base.getNativeBits(); int task = HELP; - boolean embedJava = true; + boolean embedJava = true; // Turns out the output goes as MacRoman or something else useless. // http://code.google.com/p/processing/issues/detail?id=1418 try { systemOut = new PrintStream(System.out, true, "UTF-8"); systemErr = new PrintStream(System.err, true, "UTF-8"); - + } catch (UnsupportedEncodingException e) { e.printStackTrace(); System.exit(1); } - + // File preferencesFile = Base.getSettingsFile("preferences.txt"); // System.out.println("Preferences file at " + preferencesFile.getAbsolutePath()); - + for (String arg : args) { if (arg.length() == 0) { // ignore it, just the crappy shell script @@ -133,7 +133,7 @@ public class Commander implements RunnerListener { } else if (arg.equals(exportApplicationArg)) { task = EXPORT; - + } else if (arg.equals(noJavaArg)) { embedJava = false; @@ -196,6 +196,7 @@ public class Commander implements RunnerListener { System.exit(0); } +<<<<<<< HEAD if (outputSet) { if (outputPath == null) { complainAndQuit("An output path must be specified.", true); @@ -213,6 +214,19 @@ public class Commander implements RunnerListener { if (!outputFolder.mkdirs()) { complainAndQuit("Could not create the output folder.", false); +======= + if (outputPath == null) { + complainAndQuit("An output path must be specified.", true); + } + + outputFolder = new File(outputPath); + if (outputFolder.exists()) { + if (force) { + Base.removeDir(outputFolder); + } else { + complainAndQuit("The output folder already exists. " + + "Use --force to remove it.", false); +>>>>>>> remotes/upstream/master } } @@ -331,9 +345,9 @@ public class Commander implements RunnerListener { // TODO if column not specified, should just select the whole line. // But what's the correct syntax for that? systemErr.println(filename + ":" + - line + ":" + column + ":" + + line + ":" + column + ":" + line + ":" + column + ":" + " " + re.getMessage()); - + } else { // no line number, pass the trace along to the user exception.printStackTrace(); } diff --git a/app/src/processing/mode/java/JavaBuild.java b/app/src/processing/mode/java/JavaBuild.java index f42d0930d..e6db686ba 100644 --- a/app/src/processing/mode/java/JavaBuild.java +++ b/app/src/processing/mode/java/JavaBuild.java @@ -1538,7 +1538,7 @@ public class JavaBuild { PrintWriter pw = PApplet.createWriter(argsFile); // Since this is only on Windows, make sure we use Windows CRLF - pw.print(runOptions + "\r\n"); + pw.print(PApplet.join(runOptions.toArray(new String[0]), " ") + "\r\n"); pw.print(sketch.getName() + "\r\n"); pw.print(exportClassPath); diff --git a/build/build.xml b/build/build.xml index 736f95f26..60f2540b3 100755 --- a/build/build.xml +++ b/build/build.xml @@ -152,7 +152,7 @@ - + @@ -542,10 +542,11 @@