Saturday, March 5, 2011

Re: calling macros single time and multiple times - what's difference?

On Mar 5, 2:52 am, Ben Schmidt <mail_ben_schm...@yahoo.com.au> wrote:
> > Hello!
> > There's macros: it uses value from register to perfom modifications
> > dependent on this value and then stores new value back into register.
> > It's like macro with a state. It makes its job when called once with
> > @<register>  but it fails when called multiple times with
> > <number>@<register>. Why?
>
> I think this is because when Vim does <number>@<register> it looks up
> <register> just once, duplicates it <number> times and then executes it.
> I don't think it counts <number> separate applications of the @
> operator, i.e. it doesn't look up and execute the register <number>
> times.
>

If this is the case, a recursive macro might work. Which would make
this one of the only situation's I've seen where a recursive macro
does something better than a macro with a count. Normally it does just
about the same thing.

--
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

No comments:

Post a Comment