nvim-neo-tree / neo-tree.nvim

Neovim plugin to manage the file system and other tree like structures.
MIT License
3.92k stars 225 forks source link

BUG: [Neo-tree ERROR] Error setting nodes: .../.local/share/nvim/lazy/nui.nvim/lua/nui/tree/init.lua:36: duplicate node id/Users/<project_path>/.flake8 #1578

Open sankarraj-ps opened 1 month ago

sankarraj-ps commented 1 month ago

Did you check docs and existing issues?

Neovim Version (nvim -v)

NVIM v0.10.2 Build type: Release LuaJIT 2.1.1727870382

Operating System / Version

MacOS 14.7 (23H124)

Describe the Bug

When try to open the neo-tree sidebar getting this error and I cannot load the neo-tree buffer.

It says [Neo-tree ERROR] Error setting nodes: .../.local/share/nvim/lazy/nui.nvim/lua/nui/tree/init.lua:36: duplicate node id/Users//.flake8

Mostly it has issues with .flake8 file.

Steps to Reproduce

  1. Just open neovim and try to open the neo-tree buffer

Expected Behavior

  1. Should show my files

Your Configuration

{
  "nvim-neo-tree/neo-tree.nvim",
  branch = "v3.x",
  dependencies = {
    "nvim-lua/plenary.nvim",
    "nvim-tree/nvim-web-devicons",
    "MunifTanjim/nui.nvim",
    'saifulapm/neotree-file-nesting-config', -- add plugin as dependency. no need any other config or setup call
  },
  opts = {
    -- recommanded config for better UI
    hide_root_node = true,
    retain_hidden_root_indent = true,
    filesystem = {
      filtered_items = {
        show_hidden_count = false,
        never_show = {
          '.DS_Store',
        },
      },
    },
    default_component_configs = {
      indent = {
        with_expanders = true,
        expander_collapsed = '',
        expander_expanded = '',
      },
    },
    mappings = {
      ["P"] = { "toggle_preview", config = { use_float = false, use_image_nvim = true } },
      ["l"] = "focus_preview",
      ["<C-b>"] = { "scroll_preview", config = { direction = 10 } },
      ["<C-f>"] = { "scroll_preview", config = { direction = -10 } },
    },
    update_focused_file = {
      enable = true,
      update_cwd = true,
    },
    view = {
      width = 30,
      side = "left",
      auto_resize = false,
    },

  },
  config = function(_, opts)
    opts.nesting_rules = require('neotree-file-nesting-config').nesting_rules

    vim.keymap.set("n", "<tab>", ":Neotree filesystem reveal left<CR>", {})
    vim.keymap.set("n", "<C-b>", ":Neotree focus buffers left<CR>", {})
    vim.keymap.set("n", "<C-g>", ":Neotree focus git_status left<CR>", {})

    require("neo-tree").setup(opts)
  end
}
jeffglover commented 3 weeks ago

I'm getting a similar error with .python-version.

[Neo-tree ERROR] Error setting nodes: ...er/.local/share/nvim/lazy/nui.nvim/lua/nui/tree/init.lua:36: duplicate node id/home/<user>/<project_path>/.python-version

Neovim Version (nvim -v)

NVIM v0.10.2 Build type: RelWithDebInfo LuaJIT 2.1.1727870382

Operating System / Version

Arch Linux

EDIT

Adding it to filesystem.filtered_items.never_show works. I'm ok with that, as there is rarely a reason to edit it by hand anyway.

filesystem = {
  filtered_items = {
    visible = true,
    never_show = { '.git', '__pycache__', '.python-version' },
  },
...