Describe the bug
Typing ":e example.txt" opens a tab with a named file which is not created or saved on the disk.
To Reproduce
Enter a file name that doesn't exist in that path.
Expected behavior
I expect the new file to be created on the disk automatically like in the previous version did, especially cause in my workflow I need to frequently create files, make use of auto save, and compile and run files.
Environment
Bugvim1.11.0Windows_NT x64 10.0.183621.38.1Is this a regression to #2274 or by new design?
Quoting https://github.com/VSCodeVim/Vim/commit/f70c8aa9f782881ebfe9f9de33952faa5e9a7f2c:
In the actual Vim, commands like ":e" do not create a file first if the path in the cmd doesn't exist. Rather, it creates an empty buffer and only create the file on write.
This commits changes the behavior to be more consistent with actual Vim by using untitled document instead creating the file if the file on the cmd is not found.
I'd say the behavior you describe is by design since it follows the original Vim behavior.
@joanrieu thanks for your in-depth reply.
I understand the current behavior equals to the original Vim. But I have a few more consideration over whether to apply it to VS Code Vim Extension as well. Let me explain:
File: New Untitled File and :e filename.ext because the first command don't accept a filename at all. When you run the better analogy which I suppose is File: New File, VS Code will actually create and save an empty file with the given name.Vim don't have features like auto-save, IntelliSense, Git, etc. out of the box, so the original behavior doesn't suit VS Code workflow very well in many aspects:
According to these and maybe some other underlying problems like "won't work with another extension until I saved it first", I'll 99% definitely need to save it just after the creation. The 1% is I mistyped the filename. It鈥榮 bother and a waste of time to type :e filename.ext then :w for every file.
.vimrc or .vim plugins. I can't come up with a better way to do :e xxx and :w in a strike easily. (BTW, I can't use VS Code Vim to easily rename current file either.)Anyway, if the previous behavior won't be reverted to, then this will be a major obstacle for me to upgrade the extension starting from this version. And I'd like (and have) to learn some new way to come through it like "an option", or some emulated plugins.
Similar complaint here:
for vsp:
https://github.com/VSCodeVim/Vim/issues/4098
It also affects gf for me:
https://github.com/VSCodeVim/Vim/issues/2683
Most helpful comment
Quoting https://github.com/VSCodeVim/Vim/commit/f70c8aa9f782881ebfe9f9de33952faa5e9a7f2c:
I'd say the behavior you describe is by design since it follows the original Vim behavior.