-
Notifications
You must be signed in to change notification settings - Fork 27.9k
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
Saving and closing file can result in the file getting empty #50942
Comments
@waitingsong can you clarify what kind of VIM extension you have installed? |
@xconverge @jpoon any hints what this command does in your extension that could cause this? |
It might be a good idea to disable all plugins, then enable just VSCodeVim. I also see ESlint in the settings which does something onSave... Maybe The vim remap is saving and closing while the eslint extension is doing something in between those 2 commands |
i have disabled all other plugins except its no problem with vsc version 1.20, but problem with 1.23.1 |
Ok I can reproduce this as well, I am not really sure where the bug resides but I have a workaround for you...
This at least performs the desired action somewhat atomically so there is no issue (even though the underlying commands being done here are the same as what you have in your remapping, there is a time delay between them in :wq). In the vim extension, we are still calling the commands with an await, but I wonder if VSCode is returning instantly when a save is called, yet not actually being performed until the buffer is already cleared thus resulting in saving a cleared buffer? Not sure what you want to do here @bpasero |
@xconverge it works. thanks a lot |
The issue here was that:
The fix is now to not save the file if the underlying model has been disposed meanwhile. In other words, it is not possible to save a (non-dirty) file and close it right after without waiting for the save to finish. This was only an issue when the file was not dirty, because if the file is dirty, we prompt the user before closing the file to either save or revert it. |
This was a cool example of how responsive you (the vscode devs) have been with this product. Thanks a lot! A cool example of OSS as well with an efficient issue comment section! (Until this comment ;) ) |
Verified I could reproduce without the fix and it no longer reproduces with the fix. |
What version is the fix in? I’ve had this problem many times on prior and current version (as of 6/8/18) of vscode. |
@joeandaverde This fix is in 1.24.0 and yesterday's insiders build. If you are on these or newer builds, could you open a new bug report? |
I saw this issue in 1.24.0 and 1.23.1 I thought it was an issue with Prettier. Unfortunately, I am unable to reproduce. |
Issue Type: Bug
I map
shift+z+z
to save and close active editor with vim plugin.It works good with vs code version 1.20 ( VSCodeSetup-x64-1.20.1.exe), but got problem with latest version 1.23.1:
.ts
file containing some codesshift+z+z
triggeredVS Code version: Code 1.23.1 (d0182c3, 2018-05-10T17:11:17.614Z)
OS version: Windows_NT x64 6.1.7601
System Info
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: unavailable_software
video_decode: enabled
video_encode: enabled
vpx_decode: unavailable_software
webgl: enabled
webgl2: enabled
Extensions (2)
config:
The text was updated successfully, but these errors were encountered: