glacambre / firenvim

Embed Neovim in Chrome, Firefox & others.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to disable takeover for particular sites, a.k.a. blacklist

VAggrippino opened this issue · comments

  • OS Version: win x86-64
  • Browser Version: Google Inc. Chrome 112.0.0.0
  • Browser Addon Version: 0.2.14
  • Neovim Plugin Version: 0.2.14
  • Neovim Version: v0.8.0-1210-gd367ed9b2

What I tried to do

I tried to disable takeover for https://techhub.social using the method described in the readme:

vim.g.firenvim_config.localSettings["https://techhub\.social/"] = { takeover = 'never', priority = 1 }

What happened

The following error message appears when running nvim in the terminal and firenvim doesn't work anywhere:

E5112: Error while creating lua chunk: C:\Users\vince\AppData\Local\nvim\init.lua:90: invalid escape sequence near '"https://techhub'

The same thing happens when I try exactly the .co.uk example from the README.

I've tried a few other things:

Inspired by #1401 :

vim.cmd[[
  let g:firenvim_config = {
  \ 'localsettings': {
  \   '.*': {
  \     'priority': 0,
  \     'takeover': 'always'
  \   },
  \   'https://techhub.social': {
  \     'priority': 1,
  \     'takeover': 'never'
  \   }
  \ }
  \}
]]

Result: No error, but firenvim takes over everywhere.

... or ...

vim.g.firenvim_config = {
  localSettings = {
    '.*': {
      priority = 0,
      takeover = 'always'
    },
    'https://techhub.social': {
      priority = 1,
      takeover = 'never'
    }
  }
}

Result:

E5112: Error while creating lua chunk: C:\Users\vince\AppData\Local\nvim\init.lua:79: '}' expected (to close '{' at line 78) near ':'

Firenvim doesn't work, but submit buttons are disabled.

Note: Line 78 is the first line of this block and I've double- and triple-checked that all curly braces are balanced.

invalid escape sequence near '"https://techhub'

Thanks for reporting this. This problem was introduced when I translated the examples from VimScript to Lua, I fixed it now.

vim.cmd[[

Your example seems correct, but I'm noticing your have a double h in techhub instead of a single one like for the other examples. This might be the reason the pattern doesn't work?

'}' expected (to close '{' at line 78) near ':'

This is because you are using a colon in 'https://techhub.social': {. It should be 'https://techhub.social' = { instead, as the Lua syntax uses equals signs instead of colons in order to describe objects. Let me know if that solves your issue.