Skip to content

add option to use width as percentage #462

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

Closed
wants to merge 3 commits into from
Closed

add option to use width as percentage #462

wants to merge 3 commits into from

Conversation

booperlv
Copy link
Contributor

adds option to use nvim_tree_width as a percentage (reads the width as a percentage and converts to decimal, multiply to vim total columns)

Copy link
Member

@kyazdani42 kyazdani42 left a comment

Choose a reason for hiding this comment

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

thanks for the feature, a few formatting issues to fix before merging :)

Copy link
Member

@kyazdani42 kyazdani42 left a comment

Choose a reason for hiding this comment

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

oh yes and please add documentation for the option

@booperlv
Copy link
Contributor Author

Sorry for the odd code, whipped this up as a quick fix while on a break from other projects.
Will clean up in a few, Thanks!

@booperlv booperlv requested a review from kyazdani42 June 28, 2021 07:33
@booperlv
Copy link
Contributor Author

One more question by the way, Where do you think it would be best to place the option in the documentation? Would right under g:nvim_tree_width be better or is it good as is right now?

@sindrets
Copy link
Contributor

Some thoughts: do we really need another option for this? Seems really unnecessary. Can we not just make it so that nvim_tree_width also accepts a string, and then we can determine whether or not it's a percentage depending on the value.

let g:nvim_tree_width = 30 " indicates width of 30 columns.
let g:nvim_tree_width = '30%' " indicates width of 30% of '&columns'.

@gegoune
Copy link
Collaborator

gegoune commented Jun 28, 2021

That is very reasonable.

@kyazdani42
Copy link
Member

agreed with sindrets proposal, looks better this way :)

@booperlv
Copy link
Contributor Author

alright, going to start working on it :)

@booperlv
Copy link
Contributor Author

Opened a new pull request ( #473 ) with the suggested changes, both because I think it's different, and because I messed up resetting the fork's master branch and ended up deleting the fork. The more I learn about git and not messing around with it at 2AM. Closing this one now :D

@booperlv booperlv closed this Jun 28, 2021
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.

4 participants