| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 580316b commit fe6047e
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -70,6 +70,7 @@ public class Sketch { | |||
| 70 | 70 | ||
| 71 | 71 | private SketchCode current; | |
| 72 | 72 | private int currentIndex; | |
| 73 | + | ||
| 73 | 74 | /** | |
| 74 | 75 | * Number of sketchCode objects (tabs) in the current sketch. Note that this | |
| 75 | 76 | * will be the same as code.length, because the getCode() method returns | |
@@ -83,28 +84,6 @@ public class Sketch { | |||
| 83 | 84 | /** Moved out of Editor and into here for cleaner access. */ | |
| 84 | 85 | private boolean untitled; | |
| 85 | 86 | ||
| 86 | - // /** Class path determined during build. */ | ||
| 87 | - // private String classPath; | ||
| 88 | - // | ||
| 89 | - // /** | ||
| 90 | - // * This is *not* the "Processing" libraries path, this is the Java libraries | ||
| 91 | - // * path, as in java.library.path=BlahBlah, which identifies search paths for | ||
| 92 | - // * DLLs or JNILIBs. (It's Java's LD_LIBRARY_PATH, for you UNIX fans.) | ||
| 93 | - // */ | ||
| 94 | - // private String javaLibraryPath; | ||
| 95 | - // | ||
| 96 | - // /** | ||
| 97 | - // * List of library folders, set up in the preprocess() method. | ||
| 98 | - // */ | ||
| 99 | - // private ArrayList<Library> importedLibraries; | ||
| 100 | - // //private ArrayList<File> importedLibraries; | ||
| 101 | - | ||
| 102 | - /** | ||
| 103 | - * Most recent, default build path. This will contain the .java files that | ||
| 104 | - * have been preprocessed, as well as any .class files that were compiled. | ||
| 105 | - */ | ||
| 106 | - // private File buildFolder; | ||
| 107 | - | ||
| 108 | 87 | ||
| 109 | 88 | /** | |
| 110 | 89 | * Used by the command-line version to create a sketch object. | |
@@ -336,10 +315,10 @@ public void handleRenameCode() { | |||
| 336 | 315 | // TODO maybe just popup a text area? | |
| 337 | 316 | renamingCode = true; | |
| 338 | 317 | String prompt = (currentIndex == 0) ? | |
| 339 | - Language.text("editor.sketch.rename.description") : Language.text("editor.tab.rename.description"); | ||
| 318 | + Language.text("editor.sketch.rename.description") : | ||
| 319 | + Language.text("editor.tab.rename.description"); | ||
| 340 | 320 | String oldName = (current.isExtension(mode.getDefaultExtension())) ? | |
| 341 | 321 | current.getPrettyName() : current.getFileName(); | |
| 342 | - // editor.status.edit(prompt, oldName); | ||
| 343 | 322 | promptForTabName(prompt + ":", oldName); | |
| 344 | 323 | } | |
| 345 | 324 | ||
@@ -788,8 +767,10 @@ public boolean save() throws IOException { | |||
| 788 | 767 | if (!saveAs()) return false; | |
| 789 | 768 | } | |
| 790 | 769 | ||
| 791 | - for (int i = 0; i < codeCount; i++) { | ||
| 792 | - if (code[i].isModified()) code[i].save(); | ||
| 770 | + for (SketchCode sc : code) { | ||
| 771 | + if (sc.isModified()) { | ||
| 772 | + sc.save(); | ||
| 773 | + } | ||
| 793 | 774 | } | |
| 794 | 775 | calcModified(); | |
| 795 | 776 | return true; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -148,7 +148,8 @@ static public void copyFile(File sourceFile, | |||
| 148 | 148 | ||
| 149 | 149 | ||
| 150 | 150 | /** | |
| 151 | - * Grab the contents of a file as a string. | ||
| 151 | + * Grab the contents of a file as a string. Connects lines with \n, | ||
| 152 | + * even if the input file used \r\n. | ||
| 152 | 153 | */ | |
| 153 | 154 | static public String loadFile(File file) throws IOException { | |
| 154 | 155 | String[] contents = PApplet.loadStrings(file); | |
@@ -158,9 +159,15 @@ static public String loadFile(File file) throws IOException { | |||
| 158 | 159 | ||
| 159 | 160 | ||
| 160 | 161 | /** | |
| 161 | - * Spew the contents of a String object out to a file. | ||
| 162 | + * Spew the contents of a String object out to a file. As of 3.0 beta 2, | ||
| 163 | + * this will replace and write \r\n for newlines on Windows. | ||
| 164 | + * https://github.com/processing/processing/issues/3455 | ||
| 162 | 165 | */ | |
| 163 | 166 | static public void saveFile(String str, File file) throws IOException { | |
| 167 | + if (Base.isWindows()) { | ||
| 168 | + String[] lines = str.split("\\r?\\n"); | ||
| 169 | + str = PApplet.join(lines, "\r\n"); | ||
| 170 | + } | ||
| 164 | 171 | File temp = File.createTempFile(file.getName(), null, file.getParentFile()); | |
| 165 | 172 | try { | |
| 166 | 173 | // fix from cjwant to prevent symlinks from being destroyed. | |
@@ -185,7 +192,7 @@ static public void saveFile(String str, File file) throws IOException { | |||
| 185 | 192 | boolean result = file.delete(); | |
| 186 | 193 | if (!result) { | |
| 187 | 194 | throw new IOException("Could not remove old version of " + | |
| 188 | - file.getAbsolutePath()); | ||
| 195 | + file.getAbsolutePath()); | ||
| 189 | 196 | } | |
| 190 | 197 | } | |
| 191 | 198 | boolean result = temp.renameTo(file); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -6,6 +6,9 @@ X throw an error when using methods that require sketchPath outside setup() | |||
| 6 | 6 | X https://github.com/processing/processing/issues/3433 | |
| 7 | 7 | X cursor(CROSS) breaks when using surface.setTitle() | |
| 8 | 8 | X https://github.com/processing/processing/issues/3472 | |
| 9 | + X Fix null pointer exception in setVertex | ||
| 10 | + X https://github.com/processing/processing/pull/3553 | ||
| 11 | + X https://github.com/processing/processing/issues/3550 | ||
| 9 | 12 | ||
| 10 | 13 | fixed earlier | |
| 11 | 14 | X blend() and copy() are not pixel accurate for copy/scale | |
@@ -16,6 +19,7 @@ andres/jakub | |||
| 16 | 19 | X toggling between noLights and PointLight in draw() behaving strangely | |
| 17 | 20 | X https://github.com/processing/processing/issues/3546 | |
| 18 | 21 | ||
| 22 | + _ implement strip(), lstrip(), rstrip? | ||
| 19 | 23 | ||
| 20 | 24 | docs | |
| 21 | 25 | _ note that full screen and present are now different | |
| Back | FazBrowse Home | New Git URL |
0 commit comments