Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't change file name capitalisation while renaming in the folder view #1201

Closed
1 of 3 tasks
Haagenti opened this issue May 12, 2016 · 11 comments
Closed
1 of 3 tasks

Comments

@Haagenti
Copy link

Haagenti commented May 12, 2016

Summary

When working on a folder with Sublime, if I try to change the capitalisation of a file without changing the actual file name (e.g. capitalisation.txt to Capitalisation.txt), it says that the file already exists and it returns an error.

Expected behavior

it should rename the file correctly to the new capitalisation.

Actual behavior

The file isn't renamed and an "file already exists" error is returned

Steps to reproduce

  1. Open a folder with files inside in Sublime through the "Open Folder" dialog
  2. Right-click on a file
  3. Choose "Rename..."
  4. Change only the capitalisation of the file (e.g. capitalisation.txt to Capitalisation.txt)

Environment

  • Operating system and version:
    • Windows 10
    • Mac OS ...
    • Linux ...
  • Sublime Text:
    • Build 3103
@jfcherng
Copy link

jfcherng commented May 12, 2016

Because Windows' filesystem (API?) is case-insensitive.


Maybe ST could rename the file into a random name before an actual renaming?

@sparr
Copy link

sparr commented Jun 10, 2016

This bug exists on OSX as well with the default HFS+ options.

The fix is probably to check if the file that already exists is the same file that's being renamed.

@James-E-Adams
Copy link

+1. This issue would be great to have fixed. :)

@keith-hall
Copy link
Collaborator

This has been fixed in build 3133

@keith-hall keith-hall added this to the Build 3133 milestone Jun 2, 2017
@alecmev
Copy link

alecmev commented Jun 29, 2017

I'm on build 3139 on Windows, and here's what happens for me:

  1. main -> Main: nothing happens, the file remains lowercase main
  2. main -> main2 -> Main: the file gets renamed as expected

Is this the intended behavior?

@4sh3
Copy link

4sh3 commented Aug 9, 2017

OMG, in my case is not working... Can't rename a file from server.php to Server.php with the last version of sublime, try it, download from the web page to Windows 10 64b

@PalashBansal
Copy link

This has been fixed in build 3133

@keith-hall As its a windows file system problem and occurs from other applications too, like if we do "Save as" from Visual studio of some file. I am not getting how you fixed it.
Can you please help, i can't see myself as Sublime isn't open source.

@jfcherng
Copy link

jfcherng commented Oct 20, 2019

@PalashBansal Unless a ST staff answer it here, no one knows how it's fixed. But isn't foo -> tmp_xxxxxxxxx -> Foo an easy solution?

Another note, I think here is NOT an official ST bug tracker but a community-driven one 😉

@PalashBansal
Copy link

Thanks a lot @jfcherng for referencing the example.
Problem I am facing is because of using windows.h function GetSaveFileName which does all the work for me-

  1. Opens the file save dialog
  2. Takes the new file name
  3. Ignores its case sensitiveness and asks to overwrite file
    and then just returns a bool value.
    While using this same windows API, not able to figure out solution to the problem.

@jfcherng
Copy link

jfcherng commented Oct 20, 2019

@PalashBansal

Your situation is different from this issue (which is about renaming with ST's sidebar menu).

As for the "Save as..." (usually ctrl+shift+s in applications), I don't think ST fixes the case sensitiveness problem after my quick experiment (i.e., try to save foo.txt with Foo.txt). ST just open a save dialog like other applications (notepad++) do and the filename doesn't change after saving 😢

@PalashBansal
Copy link

Thanks a lot @jfcherng for looking into, I don't need to install and try into ST now.
I was actually looking this for notepad++ only-
#notepad-plus-plus/notepad-plus-plus#3615

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants