-
-
Notifications
You must be signed in to change notification settings - Fork 617
API: tree.resize #2598
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
Comments
If I'm correct, the type of the • {width} (string | number | table | function()) new |nvim-tree.view.width| value Feel free to correct me if I'm being wrong here! Also, I think the From my local tests, adding a string with a number works, but adding a non-number string would throw an error. > "a" + 1
stdin:1: attempt to add a 'string' with a 'number'
stack traceback:
[C]: in metamethod 'add'
stdin:1: in main chunk
[C]: in ? Whereas adding a string-number with a number does work as intended. > "-10" + 30
20 But this feels safer and more natural to do this with numbers. Your call here! Also, I would have called this option require("nvim-tree.api").resize({absolute = 30}) -- For a width that is equal to 30
require("nvim-tree.api").resize({relative = -10}) -- For a width that is decreased by 10
require("nvim-tree.api").resize({relative = +5}) -- For a width that is increased by 5
require("nvim-tree.api").resize({relative = 5}) -- Same thing, since positive numbers do not need signs Other than that, this looks good to me for a future PR. Thank you for your valuable work! |
Thank you.
Of course.
That could work. It's not necessary, however it would be easier. |
* feat(#2598): Implemented API `tree.resize` * rely on when resize * Fix docs --------- Co-authored-by: Alexander Courtis <[email protected]>
Background: #2595
Add API similar to
:NvimTreeResize
.It may be best to have 3 methods due to the exclusive nature of the options. Look at api.txt and lua.txt for guidance.
The text was updated successfully, but these errors were encountered: