Skip to content

Commit e14afe4

Browse files
committed
Fix renaming from RGB to Rgb.java and others
1 parent 57953ad commit e14afe4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

app/src/processing/app/Sketch.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,9 +493,10 @@ protected void nameCode(String newName) {
493493
// A regression introduced by Florian's bug report (below) years earlier.
494494
if (!(renamingCode && sanitaryName.equals(current.getPrettyName()))) {
495495
// Make sure no .pde *and* no .java files with the same name already exist
496+
// (other than the one we are currently attempting to rename)
496497
// http://processing.org/bugs/bugzilla/543.html
497498
for (SketchCode c : code) {
498-
if (sanitaryName.equalsIgnoreCase(c.getPrettyName())) {
499+
if (c != current && sanitaryName.equalsIgnoreCase(c.getPrettyName())) {
499500
Base.showMessage("Nope",
500501
"A file named \"" + c.getFileName() + "\" already exists at\n" +
501502
"\"" + folder.getAbsolutePath() + "\"");

0 commit comments

Comments
 (0)