-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
Commit should display warning if there are unsaved files in the project #33004
Comments
There isn't any current API which lets us do this. cc @jrieken |
Well, you could call |
OMG yes! I do this way too often. It would help if VSCode used the same "Save All" shortcut that every other app on Windows uses (ctrl+shift+s). Still, this seems like a "no brainer" kind of warning. Heck I'd be fine if it was opt-in just as long as I could configure VSCode to warn me. |
Actually not so sure about that. You can loop over the array of text documents and check the |
Isn't that array just the visible ones? You can have unsaved documents that won't appear in that array, right? |
Nope, that is all open documents, the visible once are for the editors, so no tabs |
@joaomoreno & @jrieken Looks like the window.visibleTextEditors is nothing but the file that is the user is currently viewing. If I split the screen into 2 then I get the value 2 else its always 1 irrespective of the number of tabs. |
Yeah, don't look at editor but at documents, e.g. |
…h unsaved changes
Fixed by #36364 |
@bpasero Unfortunately this had to go behind a feature flag: |
@joaomoreno oh ok, I was searching for a setting but was looking for "warning" and was not finding it by that. |
I often forget to save some files before SCM commit, it would be great to receive warning. Maybe it should be an optional feature.
The text was updated successfully, but these errors were encountered: