abingham / traad

An JSON+HTTP server for the rope Python refactoring library
MIT License
107 stars 20 forks source link

Undo of a traad-rename-current-file fails. #29

Closed abingham closed 11 years ago

abingham commented 12 years ago

If I rename a file to "yaks.py" and then undo that change, I get an error like this:

error in process filter: File /home/abingham/projects/udcheck/udcheck/yaks.py no longer exists!

We're probably just making some assumption about the existence of the un-renamed file (yaks.py in this case) somewhere in a buffer-refresh call or something.

abingham commented 12 years ago

More clues: If I call "traad-undo" from some buffer other than the one which the undo will remove, then this error doesn't happen. So it seems even more clear that this has to do with some simple logic error in the undo code which expects the file to still exist.

abingham commented 11 years ago

traad-maybe-revert now checks for file existence before reverting it. This fixes the primary error. In the future it might be nice to see if we can actually remove the buffer for the missing file and replace it with the correct one. This will require examining the results of the undo, I suppose...I'm not sure if the information is there or not.