[Vimperator] map patch

Doug Kearns dougkearns at gmail.com
Fri Dec 7 06:51:17 PST 2007


On 12/8/07, Martin Stubenschrott <stubenschrott at gmx.net> wrote:
> On Sat, Dec 08, 2007 at 12:12:55AM +1100, Doug Kearns wrote:
> > var [lhs, rhs] = args.split(/\s+/);
>
> Just to note that this has different semantics, for strings like:
> :map a b c
>
> which is interpreted correctly by vim, but with this regexp it would be
> like:
>
> :map a b

Ugh, I had intended: args.split(/\s+/, 2)

But that doesn't work either. It seems JavaScript's split() 'follows'
neither Python (which, from memory, applies the pattern N times) nor
Perl/Ruby/Java et al (which apply the pattern N - 1 times).

I'm probably missing something obvious at this late hour but the JS
implementation doesn't seem all that useful.

Some days you should just quit after the first nine...

Doug


More information about the Vimperator mailing list