Repository navigation
Prompt user with dialog if triggering open with on unsaved file - #115264
Logan Ramos (lramos15) wants to merge 2 commits into
Conversation
| const options = activeEditorPane.options; | ||
| const group = activeEditorPane.group; | ||
| // The current editor needs to be saved before it can be triggered with open with | ||
| if (activeInput.isDirty()) { |
There was a problem hiding this comment.
Will this fire even if you select the default VS Code editor? Also, should it only be fired if you select a custom binary editor since a custom text editor should be able to handle this case correctly?
There was a problem hiding this comment.
Mainly wondering if it should be moved into the call to openEditorWith instead after you have selected an editor but before it has actually replaced the old editor
Benjamin Pasero (bpasero)
left a comment
There was a problem hiding this comment.
I think the logic of asking the user for dealing with dirty files should move into the editorOpenWith method which already contains the logic to show a picker etc. The action should simply call that method as before and let the helper deal with it. That way we ensure consistent behaviour in case the method is called from other places.
Besides, we need to make sure that the dialog is consistent with our current dialog when a file is dirty:
As you can see, we do not use Abort. The dialog is defined here:
Ideally you could just use the same dialog for your purpose.
|
I have added #116272 where I feel we should cleanup |
|
I believe now that with the work in #100281 you do not have to do anything special. If we end up calling |
|
My comment #115264 (comment) was wrong, but with f294b6f calling |
|
Closing as in theory this is obsolete now due to Ben's changes |

Similar to #114947, my fork got deleted so I had to remake the PR and placing this in editor action offers a solution for both notebooks and custom editors. I would be open to other solutions as it feels weird being prompted before the quickpick is opened. I also think it is a little silly that you get prompted even if you select the same editor that you're in as we shouldn't force the user to take any action in that case.