Skip to content

BUG: document symbols follow_cursor error #1403

Open
@DDGRCF

Description

@DDGRCF

Did you check docs and existing issues?

  • I have read all the docs.
  • I have searched the existing issues.
  • I have searched the existing discussions.

Neovim Version (nvim -v)

0.9.5

Operating System / Version

Ubuntu22.04

Describe the Bug

vim.keymap.set("n", "<Leader>fd",
  function() vim.cmd("Neotree toggle show document_symbols") end,
  vim.tbl_extend("force", opt, { desc = "[Neotree] open document_symbols" }))

After, I use above command, the error popup like following:

debounce  document_symbols_follow  error:  .../neo-tree/sources/document_symbols/lib/symbols_utils.lua:86: attempt to index local 'tree' (a nil value)

Screenshots, Traceback

message like above

Steps to Reproduce

  1. <Leader>fd

Expected Behavior

no error

Your Configuration

local neo_tree_config = {
	open_files_do_not_replace_types = {
		"terminal",
		"qf",
		"trouble",
		"TelescopePrompt",
	},
	sources = {
		"filesystem",
		"document_symbols",
		"git_status",
	},
  window = {
    mappings = keymappings.window.mappings,
  },
	filesystem = {
    commands = keymappings.filesystem.commands,
		bind_to_cwd = false, -- true creates a 2-way binding between vim's cwd and neo-tree's root
		follow_current_file = {
			enabled = true,
			leave_dirs_open = false,
		},
		use_libuv_file_watcher = true,
    window = {
      mappings = keymappings.filesystem.window.mappings,
      fuzzy_finder_mappings = keymappings.filesystem.window.fuzzy_finder_mappings
    }
	},
	document_symbols = {
		follow_cursor = true,
    commands = keymappings.document_symbols.commands,
    window = {
      mappings = keymappings.document_symbols.window.mappings
    }
	},
	source_selector = {
		winbar = true,
		statusline = false,
		sources = {
			{
				source = "filesystem",
				display_name = " 󰈚 Files ",
			},
			{
				source = "git_status",
				display_name = " 󰊢 Git ",
			},
			{
				source = "document_symbols",
				display_name = "  Symbols ",
			},
		},
	},
	git_status = {
		symbols = require("plugin-config.gitsigns").icons,
    window = {
      mappings = keymappings.git_status.mappings
    }
	},
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinginvalidThis doesn't seem rightquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions