[Vimperator] macro.patch

Martin Stubenschrott stubenschrott at gmx.net
Mon Dec 10 08:55:01 PST 2007


On Mon, Dec 10, 2007 at 03:57:40PM +0100, calmar wrote:
> then I need to know how the the macro got started 'q' or whatever
> in order to stop it right there.
> 
> Now the function get called twice, once it starts (and extracts
> the first key (register) itself, the other time it stops (to
> whatever q is mapped.
> 
> when q has an argument, when q is issues a second time, it again
> wants an argument or so?

I personally would change toggleRecording to startRecording(register) which is
issued after pressing q<arg>. And stopping is done inside onKeyPress
(hardcoded) when q is pressed and v.modes.isRecording == true.

The problem right now is that when i do a :map x q, then onKeyPress is
called twice, first with x and the second time with q. You should just
record (and stop) on the 2nd onKeyPress event. I don't know where/how
exactly you have to do that.

It might require shuffling some things around in onKeyPress, don't know
by heart now, but this could also allow us to map :map <C-g> <Esc> at
the end, which does not work reliably now.

Hope I haven't confused you too much :)

--
Martin


More information about the Vimperator mailing list