[Vimperator] Cannot overwrite default map (0.6pre)

M.Terada teramako at gmail.com
Mon Feb 4 04:47:44 PST 2008


Hi.

I'm trying vimperator 0.6pre (snapshot 2008/02/02 07:30:06) .

I want to change the default map(<C-c>: stop loading) to an another
function which
if selected text is exist then copy selected text to clipboard, else
stop loading the current page.
So I write .vimperatorrc

javascript <<EOF
vimperator.mappgins.add( new vimperator.Map
  [vimperator.modes.NORMAL, vimperator.modes.VISUAL],
  ['<C-c>'],
  function(){
    var sel = window.content.document.getSelection();
    if(sel){
      vimperator.copyToClipboard(sel);
    } else {
      BrowserStop();
    }
  },{
    shortHelp: 'Copy selected text or stop loading'
  }
));
EOF

But it didn't work although works 0.5.3 with little change.

I looked for the cause and found the method is "vimperator.events.onKeyPress"
It's seemed that "isUniqueMapping" variable is added at version 0.6pre
If added the above code, "isUniqueMapping" is setted to "false" at
pressed <C-c>.

Is it a work as required ?
Why that boolean variable had be added ?
And is there a solution ?


----
teramako


More information about the Vimperator mailing list