buffer-tree
buffer-tree copied to clipboard
Fix tree breaking on directory listings
This fixes an error when a buffer contains a folder and another buffer contains a file in that folder.
Example repro steps:
- open c:\myfolder in a buffer (a directory listing)
- open c:\myfolder\foo.txt in a buffer
- run BufferTree
In the first iteration of GetTree, the folder will be added as a buffer_number, not as a dictionary. The second iteration then throws an error when trying to use it as a dictionary in let dir = dir[step].
The fix is to add directories as dictionaries, always.
Example of the issue:
:ls
3 h= "." line 1
4 %a "test.vim" line 1
:BufferTree
Error detected while processing function tree#BufferTree[3]..GetTree:
line 12:
E689: Can only index a List, Dictionary or Blob
└─ C:/Users/username ⇒ 3