glacambre / firenvim

Embed Neovim in Chrome, Firefox & others.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

firenvim has weird problem on firefox

gaofengnan opened this issue · comments

  • OS Version: MacOS Ventura 13.3.1(a)
  • Browser Version: Firefox 113.0.1
  • Browser Addon Version: 0.2.14 firefox add-on store version of Nov 5, 2022
  • Neovim Plugin Version: newest (how do I check the version number?)

What I tried to do

I tried to use it in Firefox.

What happened

I spent the past two hours trying to figure out why Firenvim does not work in Firefox, while knowing that it works well in my Edge. What I discovered was that if I comment out the following lines in my init.vim, it works in Firefox.

  let g:firenvim_config = {
      \ 'globalSettings': {
          \ 'alt': 'all',
      \  },
      \ 'localSettings': {
          \ '.*': {
              \ 'cmdline': 'neovim',
              \ 'priority': 0,
              \ 'selector': 'textarea',
              \ 'takeover': 'never',
          \ },
      \ }
  \ }

Please note that it works in Edge regardless whether these above lines are commented out. But why? It makes no sense. Especially since the same above setting works well on Firefox in my Windows machine. I don't have /tmp/stdin or /tmp/stdout on my problematic Mac machine, in case you would ask me for them.

What is even more peculiar is that even when it works (when the above config is commented out), it does not work well. For instance, when I click in a text box, firenvim jumps out (which is not what I desire but the config file to disable such behaviour is commented out), but when I :x to close the nvim instance, I cannot call it by the add-on shortcut. Only if I go to another tab and come back, a new nvim instance pops up.

None of the weird things happened on my Windows machine, and I don't know what is wrong.

I think the problem might that you have windows-style line endings in your init.vim while you need them to be unix-style on mac/linux. Could you open your init.vim in neovim, run :set ff=unix, :write the file, close it and then restart your browser and attempt to use firenvim again?

I think the problem might that you have windows-style line endings in your init.vim while you need them to be unix-style on mac/linux. Could you open your init.vim in neovim, run :set ff=unix, :write the file, close it and then restart your browser and attempt to use firenvim again?

No, I just tried. I have attached both my vimrc and init.vim files.
vimrc.txt
init.vim.txt