Skip to content

Strict Matching Of NvimTree Buffers #1639

Closed
@alex-courtis

Description

@alex-courtis

#1629 demonstated incorrect handling of buffers named NvimTree* on startup.

There are further cases, mostly autocommands, in which similar tests will need to be applied. Something like:

  if opts.view.centralize_selection then
    create_nvim_tree_autocmd("BufEnter", {
      pattern = "NvimTree_*",
      callback = function()
        if utils.is_current_buf_nvim_tree() then
          vim.schedule(function()
            local keys = api.nvim_replace_termcodes("zz", true, false, true)
            api.nvim_feedkeys(keys, "n", true)
          end)
        end
      end,
    })
  end

It's probably safe to just test the filetype as it should be set at most of these points.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions