--- a/src/eric7/JediInterface/JediServer.py Fri Jul 05 10:15:29 2024 +0200 +++ b/src/eric7/JediInterface/JediServer.py Mon Jul 29 14:43:35 2024 +0200 @@ -700,6 +700,8 @@ editor = self.__editors[uid] idString = self.__idString(editor) + editor.setCheckExternalModificationEnabled(False) + self.sendJson( "applyRefactoring", { @@ -708,8 +710,6 @@ idString=idString, ) - del self.__editors[uid] - def __cancelRefactoring(self, uid): """ Private method to cancel a given refactoring. @@ -746,6 +746,13 @@ "<p>The refactoring could not be applied.</p><p>Reason: {0}</p>" ).format(result["ErrorString"]), ) + else: + with contextlib.suppress(KeyError): + self.__editors[result["Uuid"]].reload() + self.__editors[result["Uuid"]].setCheckExternalModificationEnabled(True) + + with contextlib.suppress(KeyError): + del self.__editors[result["Uuid"]] ####################################################################### ## Methods below handle the network connection