-
-
Notifications
You must be signed in to change notification settings - Fork 61
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
Improvements to layout docs #212
Comments
Any improvements of the documentation is very welcomed! You can also add various example codes in the wiki page: https://github.com/MunifTanjim/nui.nvim/wiki/nui.layout A good place to find example codes is the test file: https://github.com/MunifTanjim/nui.nvim/blob/d12a6977846b2fa978bff89b439e509320854e10/tests/nui/layout/init_spec.lua
Yes, that's exactly it. If the first parameter is a split, the components will be mounted inside that split.
Yes, that's expected. You should take care of it when you set the sizes in percentage.
Input is actually a popup under the hood: nui.nvim/lua/nui/input/init.lua Line 28 in d12a697
But the height is fixed to nui.nvim/lua/nui/input/init.lua Line 44 in d12a697
So you can't use input with percentage size. You should set a fixed size to input, and use the |
What do you mean by "rejected"? Does it cause any error? For Popup components there's no such limitation. For Split components, it depends on these vim options:
|
That wiki doesn’t seem to exists |
It's a public wiki. Anybody should be able to create the page by going to that link. |
Ok, I read that incorrectly. I thought you suggested me to check more code samples at the wiki. That with the fact that there are links to the wiki-page in the docs made me think this was a link error. But now I see what you mean.
Oh, that grow property sounds amazing! Didn't saw it! Gonna try it. By the way, when I say the Input does not look right, it is not only the placement, but also the appearance (borders and so). Take a look at this screenshot: It is a bit detached and doesn't have any border, despite I added the border style to be rounded, like all the other Popups. Maybe I'm just doing a bad combination of properties.
I get an error saying that
But that seems to be based in certain combinations I didn't figure out yet, because that error was also thrown with this piece of code:
So, changing the first input size to be "%5" or
And that is perfectly reasonable, but is it documented anywhere? Thanks for your pointers, I will keep working on getting it right. |
Can you try setting |
Do you mean in the input config or in the layout box? As you can see, it is indeed larger, but it is still disconnected. |
Can you try with the latest commit? #231 |
Hello. The layout component is a great addition, thank you.
I think the docs can be improved. I base my observations in my own experience, feel free to correct me.
The docs mention that the first argument can be either options or a component, where component is either split or popup. Does that mean that, if I provide a split the components will be mounted inside? Or what is it for?
I also noticed that not all values are allowed for percentage strings. Anything below 10% (eg 5%, 05%) will be rejected. Is 10% the minimum or is there some other thing to consider?
If you provide values that go beyond 100% (top element being 90% and bottom 20% for example) an error is thrown at runtime.
Last but not least, the box component seems to be compatible with all nui components, but the input one doesn't seems to fit very well. It appears slightly disconnected from the rest of the layout. I can provide an screenshot later.
Regards
The text was updated successfully, but these errors were encountered: