1995eaton / chromium-vim

Vim bindings for Google Chrome.
https://chrome.google.com/webstore/detail/cvim/ihlenndgcmojhcghmfjfneahoeklbjjh
MIT License
2.25k stars 325 forks source link

site-specific config: On tab reload rerun calls #706

Open rudevdr opened 5 years ago

rudevdr commented 5 years ago

I have config like this

cvTestAlert() -> {{
  alert("hi");
  console.log(self);
}}

site '*://www.youtube.com/*' {
   call cvTestAlert
}

The issue is, the cvTestAlert is called only two times:

  1. When each time site is opened in new tab
  2. cvimrc config is saved and tab is reloaded

What I want is that each time site is reloaded, cvTestAlert is called. But if you want to rerun the method, you have to save config. Then only the function is called on reload.

I have not looked in the source code yet so I don't know the issue. But I think there is some call is fired only when some event happens like tab is opened or config is saved.

rudevdr commented 5 years ago

I have found that adding map <C-r> reloadTab<CR> in the site-specific setting is good hack for solving this issue. Still the issue is a bug, not a feature. This feature should be provided out-of-the-box.