diff -r 78d338b6d89f -r d835f48b9908 src/eric7/JediInterface/JediServer.py --- a/src/eric7/JediInterface/JediServer.py Tue Jul 16 15:14:23 2024 +0200 +++ b/src/eric7/JediInterface/JediServer.py Tue Jul 16 16:08:50 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,15 @@ "<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