So, what about executing
1000@@
as
@@999@@

(where in turn 999@@ is executed as
@@998@@
and so on ... and 2@@ as
@@1@@
and 1@@ as
@@
)?

I like the idea. Hadn't thought of using recursion when I wrote about
the issue earlier, but yes, of course, that's an obvious and simple way
to implement it. Putting together a patch would only take a couple of
minutes.

What do you think, Bram? I don't think anything could really
meaningfully make use of the current behaviour, so even though
technically it would break backward compatibility it wouldn't break
anything useful.

You can't rely on the register not changing in the first @@, thus the
following 999@@ may do something completely different.  Won't work.

Well, yes, but you could make 1000@a stuff @a999@a into the buffer and
avoid that problem.

If you mean the contents of the register changing, that was the point of
the suggestion. The contention is that if a macro changes the register
in which it is stored, it is expected that the change will take effect
immediately after that run of the macro, not after a counted number of
runs have completed. I think that's fair enough, because it's strange to
think @a@a should work differently to 2@a and hard to imagine where the
current behaviour would be useful (i.e. having only the 'last' change of
the register take effect).

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

Raspunde prin e-mail lui