On Sat, Mar 5, 2011 at 12:54 PM, Benjamin R. Haskell <[email protected]> wrote:
> On Sat, 5 Mar 2011, Donald Allen wrote:
>
>> If you delete a line, it gets pushed onto the register stack (the line
>> lands in the "" register). If you then undo the delete with 'u', the
>> register stack doesn't get popped -- it remains as it was just prior to the
>> 'undo'. So the undo has not undone all the effects of the command you are
>> undoing. 7.3 with patches through 138.
>
> Undo isn't intended to "undo all the effects of the command", per se. It
> reverses a change (or a block of changes) made to a buffer, not changes to
> the state of the entire program.  Can't quite see where in the help that's
> documented, but it seems rational to me.

Yes, I also checked the documentation before sending my original
message and also was not able to find something definitive, which was
why I appended the question mark to my subject.

Let's consider this a feature request, then. I think it's completely
reasonable to expect 'undo' to reverse the side-effects of an undone
command, where that's possible (I wouldn't expect it to undo the
changes to the filesystem as a result of a write command, for
example). In this case, I'd yanked some text that I wanted to 'put' in
a bunch of places. While going through the buffer, putting the text
where I wanted it, I noticed a line that needed to come out, so I
deleted it. Naturally, the next attempt to put gave me that line
instead of the original text I'd yanked. So I undid the put and then
undid the delete and was a bit surprised to find that the subsequent
put fetched the line, not the yanked text. Vim prides itself in making
editing efficient (and one of the reasons I'm now using it instead of
emacs is that I think overall, it delivers on that goal). But I do
think what I'm talking about would be an improvement, if it's not
unduly difficult to implement. I do concede that emacs behaves as vim
does, as does vi, but that's not a reason for not going them one
better.

/Don



>
> --
> Best,
> Ben
>
> --
> 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 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

Raspunde prin e-mail lui