Fix bug where dirty positron notebook editors wont close #2578
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Addresses #2576
Intent
Fixes issue noted by @seeM that you can get into a situation where a Positron notebook won't close.
Approach
The problem was that the notebook input was requested to run the
.revert()
method. This method is defined as a no-op on the base-classEditorInput
thatPositronNotebookEditorInput
extends. This method is called by the workbench service when trying to close the editor and then it checks to make sure the revert was successful by looking at the dirty status again. Since we weren't doing anything it takes that as us telling it to not close.