weirongxu / coc-explorer

📁 Explorer for coc.nvim
MIT License
1.14k stars 45 forks source link

Ignoring Tagbar or Vista windows when opening files #422

Closed gerazov closed 3 years ago

gerazov commented 3 years ago

Great plugin! :fireworks:

It would be nice if coc-explorer ignored the Tagbar or Vista windows for opening new files. Atm if only a single window with a buffer is open and Tagbar is present it asks where to open the file (A or B).

weirongxu commented 3 years ago

Hi @gerazov You can use explorer.openAction.select.filter option to ignored the TagBar.

gerazov commented 3 years ago

Thanks for the tip. I don't know how to set this option.

I tried adding TagBar and Tagbar in the CocConfig but it doesn't do the trick:

    "explorer.openAction.select.filter": {
        "properties": {
            "buftypes": [
                "TagBar",
            ],
            "filetypes": [
                "TagBar",
            ],
          },
        "default": {
            "buftypes": [
                "Tagbar",
                "terminal"
            ],
            "filetypes": [
              "vista_kind",
              "Tagbar",
              "qf"
            ],
        },
    },
weirongxu commented 3 years ago

You should install the coc-json, it will guide you on how to write the coc-setting.

"explorer.openAction.select.filter": {
      "buftypes": [
            "Tagbar",
            "terminal"
      ],
      "filetypes": [
            "vista_kind",
            "Tagbar",
            "qf"
      ],
},
gerazov commented 3 years ago

Thanks for the reply, but it still doesn't work. This should be in CocConfig right?

weirongxu commented 3 years ago

It should be the lowercase type name tagbar

gerazov commented 3 years ago

Ok great! :partying_face:

Thanks for your help! Maybe put it in the Readme for future users :+1:

weirongxu commented 3 years ago

I will consider add this into the default explorer.openAction.select.filter option

gerazov commented 3 years ago

Yeah makes sense - I see you already have added Vista there :+1:

durd07 commented 3 years ago

You'd better add vista beside vista_kind into filter.