boolean (@NotNull VirtualFile virtualFile, @NotNull Project project) { ThreadingAssertions.assertEventDispatchThread(); FileEditor[] editors = FileEditorManager.getInstance(project).getEditors(virtualFile); if (editors.length == 0) { return false; } UndoManager undoManager = UndoManager.getInstance(project); for (FileEditor editor : editors) { if (undoManager.isUndoAvailable(editor)) { return true; } } return false; }