Saturday, November 8, 2014

Limits to undo

Sometimes, I can undo changes even though I just :wrote the file to disk. The undo simply causes the file to change to an earlier state in time, which causes it to differ from the version written to disk. Hence, there is a [+] sign in the status line. In fact, undo seems to be able to undo changes even though there may have been multiple :writes to file during those changes.

Other times, it clearly can't go back to the original state of the file. For example, if one were editing a file "memberNumber.txt" and forgot that it wasn't tmp.txt, one could do some elaborate composition of text and multiple saves. After realizing that one was clobbering the content of memberNumber.txt rather than tmp.txt, one (the royal "one") can attempt to undo ad nauseum to get back the original content of memberNumber.txt. However, there is a point which it no longer undo's, and it is clearly not when the file has gone back to the state of its original content.

What determines whether undo can proceed backward in time beyond a certain point? The help pages don't seem to explain the above limit.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment