Skip to content

Commit

Permalink
TargetEditor.doRevert() should revert the dirty text editor
Browse files Browse the repository at this point in the history
  • Loading branch information
merks committed Jan 17, 2025
1 parent 5aa112a commit 68642a1
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
import org.eclipse.ui.forms.widgets.ScrolledForm;
import org.eclipse.ui.part.FileEditorInput;
import org.eclipse.ui.progress.UIJob;
import org.eclipse.ui.texteditor.ITextEditor;
import org.osgi.service.event.Event;
import org.osgi.service.event.EventHandler;
import org.xml.sax.SAXException;
Expand Down Expand Up @@ -331,6 +332,10 @@ public void doRevert() {
}
}
}

pages.stream().filter(ITextEditor.class::isInstance).map(ITextEditor.class::cast).filter(ITextEditor::isDirty)
.forEach(ITextEditor::doRevertToSaved);

setActivePage(getActivePage());
editorDirtyStateChanged();
}
Expand Down

0 comments on commit 68642a1

Please sign in to comment.