Skip to content

fix(#2440): view.width.padding may be a number or function returning a number #2442

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 7, 2023

Conversation

reyniersbram
Copy link
Contributor

Update accepted types for view.width option so padding can be set. See #2440.
Overrides documentation change of #2441

@Akmadan23 Akmadan23 changed the title fixes(#2440) fix(#2440): add view.width.padding to accepted types Oct 2, 2023
@Akmadan23
Copy link
Collaborator

Akmadan23 commented Oct 2, 2023

Good job! This actually fixes the issue raised by @IZ-ZI.
By the way @alex-courtis I took a brief look to nvim-tree/view.lua and having padding as string or function actually results in 0 padding, so probably it's better to only accept numbers.

Edit: I missed the get_size function and your comment, so yes, now we just have to specify in the documentation that the function should return a number.

@alex-courtis
Copy link
Member

By the way @alex-courtis I took a brief look to nvim-tree/view.lua and having padding as string

Yes. It's good to see the type validator working and protecting against this ;)

Copy link
Member

@alex-courtis alex-courtis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many thanks for your contribution!

@alex-courtis
Copy link
Member

specify in the documentation that the function should return a number.

Done

@alex-courtis alex-courtis changed the title fix(#2440): add view.width.padding to accepted types fix(#2440): view.width.padding may be a number or function returning a number Oct 7, 2023
@alex-courtis alex-courtis merged commit e153d9f into nvim-tree:master Oct 7, 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.

3 participants