nvim-tree / nvim-tree/nvim-tree.lua
Treat symbolic links as valid tree paths for root purposes
Nessuno ha ancora preso questa issue.
- Lingua principale
- Lua
- Stelle
- 8.6k
- Fork
- 638
- Merge medio
- 1g 14h
- PR unite (30g)
- 2
Descrizione
Is this a question?
No.
Can this functionality be implemented utilizing API?
Don't think so.
Is your feature request related to a problem? Please describe.
I'm editing some project files that are symbolically linked in from somewhere else but his precludes nvim-tree showing a common root that isn't system root (/). For example:
the true path to these files is in /mnt/hgfs/vmshare/ . I am editing various files in /home/russianguyovic/project/ and have the files linked into /home/russianguyovic/project/headers/ (e.g. ln -s /mnt/hgfs/vmshare/ /home/russianguyovic/project/headers/). My tree root for all other files in the project is /home/russianguyovic/project/, however for the symbolically linked files that is not possible; the closest common root nvim-tree will acknowledge is the system root, / (root). If, while focused on some file /mnt/hgfs/vmshare/stuff.h one uses :cd /home/russianguyovic/project/, the tree very briefly blinks to the new root and then goes back to /mnt/hgfs/vmshare/. The solution would be for nvim-tree to look at link location rather than the target and treat that as the leaf from which to build a path back up towards system root.
Describe the solution you'd like
nvim-tree should look at the link location, not the target, to determine where that leaf is relative to system root. (I feel like I'm doing a terrible job of explaining this. I would like the two groups of files mentioned above to both be able to use /home/russianguyovic/project/ as their nvim-tree root, to reference my hypothetical example.)
Describe alternatives you've considered
The alternative is to just live with it.
Additional context
Imagine a directory structure like so with a linked-in folder, highlighted by a red box below:

nvim-tree correctly shows the target of the symbolic link, which is cool, but it uses only the target for directory traversal pathing to determine possible roots:

If I would like to see both .viminfo and config.toml in the tree at the same time, I can only do so by using system root as the root of the nvim-tree tree:

This is less than ideal.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia riproducendo l’esempio di directory collegata dell’issue e tracciando il modo in cui nvim-tree determina una radice comune a partire da un file focalizzato. Confronta la posizione del symlink con la sua destinazione durante l’attraversamento. Il lavoro è completato quando i file sotto /mnt/hgfs/vmshare/ e /home/russianguyovic/project/ possono condividere /home/russianguyovic/project/ come radice dell’albero senza ricadere su /.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- lua
- Ambito
- devtools
- Tipo di issue
- Funzionalità
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100