nvim-neo-tree / neo-tree.nvim

Neovim plugin to manage the file system and other tree like structures.
MIT License
3.64k stars 213 forks source link

BUG: Indentation for files seems to be broken. #924

Closed oneslash closed 1 year ago

oneslash commented 1 year ago

I am working on a project where the file main.tf is located in the following path AWS/eu-west-1/INFLUX/production/main.tf.

The tree renders main.tf as it is on the same level as production folder

Screenshot 2023-05-11 at 2 43 40 PM

pysan3 commented 1 year ago

I cannot reproduce it.

Does it happen with other file name as well?

Your screen shot does not show the left end of the buffer. How far is the indentation?

It would be very nice if you could provide more details.

alptibet commented 1 year ago

i think I have found a pattern here. This bug, in my case, always affects the last folder's items in a folder tree. So in the above example, if another folder is created under 'INFLUX', that will come after 'production' I am pretty sure the main.tf will shift right under it's parent folder.

Little demonstartion: b.js is not indented.

Screenshot 2023-06-04 at 14 23 24

However if I create another file or folder after B, it will be indented.

Screenshot 2023-06-04 at 14 31 03

or

Screenshot 2023-06-04 at 14 28 20
oneslash commented 1 year ago

@alptibet good catch, yes indeed it works well if I create another file or folder.

pysan3 commented 1 year ago

i think I have found a pattern here

@alptibet Thanks a lot for the detailed explanation and screenshots. But I still cannot reproduce this error...

Could you send your config options for neo-tree you are using now? (CC @oneslash)

I'm also wondering how you managed to bring src folder at the same indent as ~/DEV/test. I thought that option was deleted quite some time ago.

oneslash commented 1 year ago

@pysan3, hi thank you 🙏

I use vanilla Astronvim config, https://github.com/AstroNvim/AstroNvim/blob/main/lua/plugins/neo-tree.lua

pysan3 commented 1 year ago

@oneslash

Quick update. Thanks for the link and I was able to reproduce the error.

The cause was this line and I will look into how to fix it.

https://github.com/AstroNvim/AstroNvim/blob/a137a014ef579122482d05cc8a58fd5f0dcc916d/lua/plugins/neo-tree.lua#L22

alptibet commented 1 year ago

@pysan3 , sorry for late response. I also use vanilla astronvim config.

pysan3 commented 1 year ago

Thanks for both of you guys.

I was able to diagnose the error and will fix it when I've got time. Please wait till this weekend or so ;)

oneslash commented 1 year ago

@pysan3, thank you very much!

alptibet commented 1 year ago

@pysan3, thank you!

pysan3 commented 1 year ago

Closing with #977