Text files are small. Even if they saved every keystroke and you type 100 chars/second for 10 hours it's less than 3.5 megabytes.
Not to mention bzip or gzip compresses text like its cotton candy.
LZMA is like gzip, but with a much larger window. It's a bit slower to compress, but much better performance.
I'm incredibly curious as to implementation too. Any of the HN boffins want to breakdown how something like this works?
The source code of Scintilla shows a good implementation of undo functionality. The only thing you'd need only you have undo was a way to serialize and unserialize the information.