Skip to content

Conversation

bprb
Copy link

@bprb bprb commented Mar 28, 2024

This fixes an error when a buffer contains a folder and another buffer contains a file in that folder.

Example repro steps:

  1. open c:\myfolder in a buffer (a directory listing)
  2. open c:\myfolder\foo.txt in a buffer
  3. 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.

@bprb
Copy link
Author

bprb commented Mar 28, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant