Sublime Forum

Blank file opened after renaming file in open dialog

#1

Opening a file in the open dialog box after renaming it in the dialog does not open the renamed file’s contents, it is just a blank file with the newly renamed filename.

  1. File->Open
  2. Navigate to a file that has some contents
  3. Rename the file
  4. Open the file without closing the dialog box

The result for me is a blank page, the filename tab of the opened file appears correct, but there is no contents.

I’m, using Windows 10 64-bit and Sublime version 3142. I just recently updated sublime text, however before the update it did not work either.

If you close the open dialog and open the dialog box again then open the file it works correctly, displaying the file’s contents.

I have searched the technical support forum and the SubliemTextIssues/Core and did not find anything about this.

0 Likes

#2

I don’t know how to fix your issue, but I do know that you’re not using ST as well as you could if you’re using File - Open.

Have a look at ctrl+p, it’s much more efficient (and therefore time saving).

If you want to rename/move/create files, you could use something like FileManager.

0 Likes

#3

I can’t directly replicate what you’re seeing on my Windows machine:

Note though that when you rename the file in the dialog, the name in the File name: box stays the same as it was when you clicked on it initially (in this case test.txt) until you click on the file again to select it under the new name. That’s standard behaviour in Windows, though (for example, Chrome does the same thing).

What may not be standard is Sublime responding to being told to open a file that doesn’t exist by just creating a blank tab under that name for you to start editing. In this case, I believe this is meant to be a feature, since it mimics what happens if you run Sublime from the command line with the name of a file that doesn’t exist.

Notepad for example will also do the same thing from the command line, although it prompts you to ask you if you really meant to create a new file, and it won’t accept the name of a file that doesn’t exist in the Open dialog.

That said, based on your steps above you are getting a tab with the correct name but empty content. If I skip the step where I click on the file first, I get a blank file opened under the previous name and not the new name.

1 Like

#4

I noticed that when I double click the file after renaming to open it opens correctly however if I hit enter after renaming it it only opens a blank tab with the correct name. I did notice you can type anything in the open box, even a non-existent file and it’ll open a blank tab with the name of the file you typed in. Which is kinda really cool I think.

0 Likes