nvim-tree / nvim-tree/nvim-tree.lua

Node Privacy

Open
#2,146 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

API
Dominant language
Lua
Stars
8.6k
Forks
639
Avg merge
1d 14h
Merged PRs (30d)
2

Description

Nodes should not be exposed to the user. They are internal representations and should not be mutated by the user.

api.tree.get_nodes and sort_by return/are passed cloned partial nodes.

api.tree.get_node_under_cursor returns the internal node. API functions that take {node} expect a real node.

Proposal:

  1. add a node identifier like a UUID
  2. all API returns a cloned node containing UUID
  3. existing api that takes {node} maps to the internal node via identifier

1 may could achieved via absolute_path, similar to sort_by.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing api.tree.get_nodes, sort_by, get_node_under_cursor, and APIs that accept {node}; compare cloned partial nodes with internal nodes. Done means returned nodes are not internal representations, while APIs accepting {node} can still resolve the corresponding internal node through its identifier.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua, neovim
Domain
tooling
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.