--- a/src/eric7/ViewManager/ViewManager.py Sun Jan 21 13:00:42 2024 +0100 +++ b/src/eric7/ViewManager/ViewManager.py Sun Jan 21 15:38:51 2024 +0100 @@ -5565,8 +5565,7 @@ @param ignoreDirty flag indicating to ignore the 'dirty' status @type bool """ - savedEditors = self.editors[:] - for editor in savedEditors: + for editor in self.editors[:]: self.closeEditor(editor, ignoreDirty=ignoreDirty) def closeWindow(self, fn, ignoreDirty=False): @@ -5606,6 +5605,15 @@ if res and editor == self.currentEditor: self.currentEditor = None + @pyqtSlot() + def closeDeviceEditors(self): + """ + Public slot to close all editors related to a MicroPython device. + """ + for editor in self.editors[:]: + if FileSystemUtilities.isDeviceFileName(editor.getFileName()): + self.closeEditor(editor, ignoreDirty=True) + def exit(self): """ Public method to handle the debugged program terminating.