Community
Participate
Working Groups
Found this while testing bug 418254. Right now the DEL handling silently closes the editor *without* saving. To repro: Open some editors and make one or more dirty Hit Ctrl + E, arrow down to one of the dirty editors and hit DEL Currently the result is that the editor is closed but not persisted first.
Committed: http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=2ffbff1d40067ce46abb5432c6bc5b76d82e98e9 This silently saves the file before closing it. There is still a defect here in that trying to *prompt* for the save causes NPE's, likely due to the prompt dialog confusing the shell management. Once we VERIFY this fix in M4 we should determine whether to re-open it for a more complete fix as resources permit.
Verified in 4.4.0.I20131209-2000. Dani / Paul, do you think that we need to do more here or is this such an odd corner case that we can leave it as is (which I'm +1 for).
(In reply to Eric Moffatt from comment #2) > Verified in 4.4.0.I20131209-2000. > > Dani / Paul, do you think that we need to do more here or is this such an > odd corner case that we can leave it as is (which I'm +1 for). I'd prefer a deeper look for two reasons: 1. It's scary for the user if the editor just closes. 2. We might do an unwanted save, e.g. when the same file is open in another window. ==> we should simply invoke the normal "close" process.
Adjusted the summary to reflect the remaining issue.
Given the time we have left I think the only tweak we have time for is to perhaps disable DEL -> Close for dirty editors. Is this an option ?
Changed to add a Save dialog, if appropriate. And, added a guard to detect editor list disposal (which was leading to NPEs). The list is disposed when the save dialog pops up. https://git.eclipse.org/r/22183
(In reply to Paul Elder from comment #6) > Changed to add a Save dialog, if appropriate. And, added a guard to detect > editor list disposal (which was leading to NPEs). The list is disposed when > the save dialog pops up. > > https://git.eclipse.org/r/22183 Submitted with http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=c72486264793cf734d7e2c74302cf0ff06f64635
.
In 4.4.0.I20140303-2000