On Sun, Mar 6, 2011 at 7:26 AM, Jan Larres <[email protected]> wrote:
> Donald Allen <[email protected]>:
>>>> 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.
>>>
>>> Then you should have been putting from register 0 instead of register ".
>>> Register 0 is the last yank, while register " is the last yank or
>>> delete.
>>
>> Yes, you are right (in fact, that's how I proceeded after realizing
>> undo didn't restore the register stack). But I'm talking about
>> ease-of-use and efficient editing, and 'p' is a lot faster and easier
>> to type than '"0p' (after all, this is the editor where Steve Oualline
>> tells you on page 6 of his book not to use the arrow keys for cursor
>> movement, because it will slow down your editing). If undo restored
>> the stack as it was before the command I undid, I could have used 'p'.
>> I also think that what I'm proposing presents a more sensible model of
>> undo to the user. Ideally, (in my opinion), after 'undo', the world
>> would be as if the undone command had never been executed. That's
>> impossible to do perfectly, I understand that. But I think vim can
>> come closer to the ideal than it does now.
>
> You should check out the YankRing plugin, it makes handling these sorts
> of situations easier:
> http://www.vim.org/scripts/script.php?script_id=1234

Both lilydjwg and Ben have raised the same valid point -- that the
register stack is not per-buffer. I don't think that makes it
impossible to implement what I requested; it just limits the cases
that can be handled (and I think what you are left with is still very
useful). But before taking the time to make my argument in detail, I
will take your suggestion and have a look at the above plugin. Perhaps
it will make my suggestion moot, which would be fine with me.

Thanks --
/Don


>
> Jan
>
> --
> -[ OpenPGP key ID: 00A0FD5F ]-
> A smoking section in a restauraunt is like having a peeing section in a
> pool.
>                -- Dave Broadfoot
>
> --
> 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