glacambre / firenvim

Embed Neovim in Chrome, Firefox & others.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[feature]: extend `selector`'s behavior to choose elements

xudyang1 opened this issue · comments

  • OS Version: Windows 10 22H2
  • Browser Version: Chrome 120.0.6099.225
  • Browser Addon Version: 0.2.15
  • Neovim Plugin Version: commit 3363c14

What I tried to do

Type <C-e> to open firenvim in page github.com/glacambre/firenvim/issues/ISSUE_NUMBERS to edit comment / post new comment

What happened

No window was open. Then, I typed <C-e> again, a firenvim window appeared at the upper left corner of the page. The filename contains selector TEXTAREA-id-feedback.

I tried to exclude the element, but the following config did not work:

vim.g.firenvim_config = {
  globalSettings = {
    alt = "all",
    cmdlineTimeout = 3000,
  },
  localSettings = {
    [".*"] = {
      cmdline = "neovim",
      content = "text",
      priority = 0,
      selector = "textarea",
      takeover = "never",
    },
    ["github.com/.*"] = {
      filename = "{hostname%32}_{pathname%32}_{selector%32}_{timestamp%32}.md",
      selector = "textarea:not(#feedback), textarea#new_comment_field",
    },
  },
}

Current solution is to manually click at the comment textarea and then type <C-e> to trigger firenvim.

This is not a bug but the intended behavior, as this enables using Firenvim on elements whose selector cannot be decided. I can see how the behavior you expected is useful though, I'll try to implement it.

This is not a bug but the intended behavior, as this enables using Firenvim on elements whose selector cannot be decided. I can see how the behavior you expected is useful though, I'll try to implement it.

Already changed it into a feature request!