Skip to content

Commit 5fbf962

Browse files
author
Federico Fissore
committed
Sketch rename: allowig a case change rename if NOT on windows. Fixes #3305
1 parent 5d3e4c1 commit 5fbf962

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/src/processing/app/Sketch.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ protected void nameCode(String newName) {
204204
// (osx is case insensitive but preserving, windows insensitive,
205205
// *nix is sensitive and preserving.. argh)
206206
if (renamingCode) {
207-
if (newName.equalsIgnoreCase(current.getCode().getFileName())) {
207+
if (newName.equalsIgnoreCase(current.getCode().getFileName()) && OSUtils.isWindows()) {
208208
// exit quietly for the 'rename' case.
209209
// if it's a 'new' then an error will occur down below
210210
return;
@@ -256,7 +256,7 @@ protected void nameCode(String newName) {
256256
// extensions, so compare the full names (including extensions). This
257257
// might cause problems: http://dev.processing.org/bugs/show_bug.cgi?id=543
258258
for (SketchCode c : data.getCodes()) {
259-
if (newName.equalsIgnoreCase(c.getFileName())) {
259+
if (newName.equalsIgnoreCase(c.getFileName()) && OSUtils.isWindows()) {
260260
Base.showMessage(_("Nope"),
261261
I18n.format(
262262
_("A file named \"{0}\" already exists in \"{1}\""),

0 commit comments

Comments
 (0)