Added undo capabilities for writing blocks of code.