Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strict Matching Of NvimTree Buffers #1639

Closed
alex-courtis opened this issue Oct 10, 2022 · 0 comments · Fixed by #1640
Closed

Strict Matching Of NvimTree Buffers #1639

alex-courtis opened this issue Oct 10, 2022 · 0 comments · Fixed by #1640
Labels
bug Something isn't working

Comments

@alex-courtis
Copy link
Member

alex-courtis commented Oct 10, 2022

#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.

@alex-courtis alex-courtis added the bug Something isn't working label Oct 10, 2022
alex-courtis added a commit that referenced this issue Oct 15, 2022
alex-courtis added a commit that referenced this issue Oct 17, 2022
…1640)

* fix(#1629): nvim start with file named *NvimTree* opens tree instead of buffer

* Revert "fix(#1629): nvim start with file named *NvimTree* opens tree instead of buffer"

This reverts commit e713607.

* fix(#1629): nvim start with file named *NvimTree* treats file as tree

* fix(#1629): nvim start with file named *NvimTree* treats file as tree

* fix(#1639): ensure tree autocommands match filetype as well as name

* fix(#1639): fix bad merge

* fix(#1639): ensure tree autocommands match filetype as well as name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant