Jason Franklin wrote:
> I still like this change. I especially like that it makes it obvious > when a region of text was already sorted (this can be useful sometimes). > > I noticed, though, that I made an omission here: > > The u_save() function is still called at the top. This means that, > even though &mod may not be set, the undo record is still created in > all cases. > > Example; > > 1. echo -e 'a\nb\nc' >foo > 2. vim --clean foo > 3. :sort > 4. :undolist > > See that there is a change to undo when no change happened and &mod > is not set. > > This is, obviously, low priority. I just wanted to not it here in case > the fix was simple enough. I tried a few things to remove the most > recent undo record when no sorting happens, but with no success. > > Not a critical problem, but I always want my patches to be perfect. There are some situations where Vi does create an undo, even though nothing changed. Whether this is OK or not depends on how you look at it. In one way, like you say, nothing changed thus ther is nothing to undo. In another way, if you use a command that usually changes the text, you should be able to hit undo, no matter what changed exactly. In cases where it's not 100% clear that changing behavior is indeed an improvement, we leave it as is. -- One difference between a man and a machine is that a machine is quiet when well oiled. /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org /// -- -- You received this message from the "vim_dev" 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_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
