Is it possible to know the max width of a section? #664
Unanswered
milanglacier
asked this question in
Q&A
Replies: 1 comment
-
I don't think there's a way to do that. At least none that I know of. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently I have a component which will be a long string. I will make truncation on that string since I don't want the string to be too lengthy to occupy the entire section (I place it at section C with other components), I want to dynamically control the length of the string.
Currently I dynamically control the length of that string using
nvim_get_win_width()
,so my current logic will be
But this is a less flexible way: since the
win_width
is dynamically changed, if thewin_width
is large, thenwin_width * 0.6
would be truncated "too much", there are still many left space can be utilized.But if
win_width
is too small, thenwin_width * 0.6
would be too lengthy, the other components atsection C
will be undisplayed sincesize_of_my_string
will occupy the entire space ofsection_c
.Is is possible to know the max width of
section c
and make dynamically change of size of string based on that?Beta Was this translation helpful? Give feedback.
All reactions