Skip to content

Conversation

@nhat-vo
Copy link
Collaborator

@nhat-vo nhat-vo commented Apr 8, 2023

Fixes #848.

The function text_layout doesn't work with the whole tab representation, which relies on vim.fn.strdisplaywidth. It seems that this function considers the tab representation string literally, and gives a length of more than 400 for just 3 tabs. The text_layout then truncates the tab representation, which results in weird values.

To fix this, I moved the text_layout logic to truncate tab.text instead.

@nhat-vo
Copy link
Collaborator Author

nhat-vo commented Apr 14, 2023

Actually I realized that I made the wrong implementation but haven't got time to redo it, so this shouldn't be merged yet.😓

@nhat-vo nhat-vo changed the title fix(source_selector): fix bug with tabs_layout fix(source_selector): fix bug with tabs_layout (WIP) Apr 14, 2023
@cseickel
Copy link
Contributor

Actually I realized that I made the wrong implementation but haven't got time to redo it, so this shouldn't be merged yet.

Can you mark this as a "draft" PR to make it clearer that it's not ready?

@nhat-vo nhat-vo marked this pull request as draft April 17, 2023 06:52
@nhat-vo nhat-vo marked this pull request as ready for review April 17, 2023 07:56
@nhat-vo nhat-vo requested a review from cseickel April 17, 2023 07:57
@nhat-vo nhat-vo changed the title fix(source_selector): fix bug with tabs_layout (WIP) fix(source_selector): fix bug with tabs_layout Apr 17, 2023
@nhat-vo
Copy link
Collaborator Author

nhat-vo commented Apr 17, 2023

@cseickel This should be ready for review.

@cseickel cseickel merged commit 7a6b0d4 into nvim-neo-tree:main Apr 17, 2023
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.

2 participants