Christian Brabandt wrote:

> > > Patch [3] :earlier <nr>f and :later <nr>f only move relative to the 
> > > current save number of the buffer. I think it would be nice to jump 
> > > right to the actual save number, as it is output with :undolist.
> > > This patch implements :undo <nr>f to let you jump right after the 
> > > specified save number. (Please verify, that the traversing the undo-tree 
> > > structure works as it is supposed to be. I am not sure this is correct, 
> > > though it seems to work)
> > 
> > The :undo command only moves in the current undo branch. This would make
> > it go to different branches, I don't like that.
> 
> Hm? If I use :undo {N} it moves to any branch that was specified, 
> doesn't it?

Right, it's already inconsistent.  A number for "u" means the number of
times to undo, for ":undo" it means a change number to jump to.  Hmm, in
that context ":undo 123f" does make sense.  But the relation with
":earlier 1f" and :later 1f" is a bit messy.  We could introduce a new
command for that.  Could be ":undojump" and accept the same arguments
are :earlier and :later, but as an absolute number.  Could also make
this work for time (conversion from string to seconds might not be so
easy though).

> > Copying the logic to find the position in the undo tree is not a good
> > idea.  Let's keep this in undo_time().  Setting "target" to the right
> > value seems the only thing needed there.
> > 
> > On the other hand, does a user really remember the absolute save number?
> > Even the one from :undolist is not clear about what the state of the
> > text was.  It only mentions the last save in a branch.
> 
> Don't know. But since the undotree() function can gives you all save 
> numbers, it would make sense to jump right after that.

Well, if you are using that function you can also see how many saves you
have to go forward or backward.  I was wondering how much it helps to be
able to do this directly.  Also because it adds quite a bit of code.

This is a hint for a much simpler implementation: subtract the current
save number from the desired one and executed an :earlier or :laster
command.  Wouldn't that work?

-- 
TIM:   That is not an ordinary rabbit ... 'tis the most foul cruel and
       bad-tempered thing you ever set eyes on.
ROBIN: You tit.  I soiled my armour I was so scared!
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.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

Raspunde prin e-mail lui