git-worktree.nvim icon indicating copy to clipboard operation
git-worktree.nvim copied to clipboard

bug? nvim quits on_tree_change when the nvim-tree plugin is installed

Open lpanebr opened this issue 3 years ago • 5 comments

I was trying the nvim-tree plugin which is a nerdTree-like but 100% lua. I know you are a netrw user but some of us mere mortals like the fuzz and whistles of those file browsers. Also given that you're THE Primeagem coconut oil supreme vim master, this is most likely a nvim-tree bug, of course. But I though I'd let you know anyway. For now I've fixed the problem by uninstalling nvim-tree. ;-) Thanks for this great plugin!

lpanebr avatar Dec 25 '21 03:12 lpanebr

Can reproduce, switch_tree didn’t work when nvim-tree was enabled, I disabled nvim-tree and it started working,

    update_focused_file = {
        enable = true,
        update_cwd = true
    },

in nvim-tree.setup() seems to be the problem, i switched it to

    update_focused_file = {
        enable = false,
        update_cwd = true
    },

and switch_tree started working

Druva-D avatar Dec 28 '21 09:12 Druva-D

Thanks @Ceres445 . I confirm the config workaround seems good.

lpanebr avatar Dec 29 '21 12:12 lpanebr

Same for me, you don't want to have auto_close enabled, too. (it does what it's supposed to do)

require'nvim-tree'.setup {
    auto_close = true
...

venc0r avatar Feb 01 '22 17:02 venc0r

I also have this problem, update_focused_fiel is very useful function in nvim-tree though, so this workaround would not work for me

punk-dev-robot avatar Mar 16 '22 10:03 punk-dev-robot

I have the following config but still seem to get weird issues with the file explorer not updating the path when switching trees. Anyone that have a working solution that could share theirs?

vim.opt.splitright = true
require'nvim-tree'.setup {
  update_focused_file = {
      enable = false,
      update_cwd = true
  },
}

Edit: The best solution I found was to also add the following so neovim opens netrw by default and when in folders I can still open nvim-tree. The only issue is that just opening nvim-tree will open the initial worktree but using the "open file in explorer" will open the correct worktree.

  disable_netrw = false,
  hijack_netrw = false,

RobertBrunhage avatar Jul 06 '22 05:07 RobertBrunhage