vim --clean
1001
):vim9script def Popup(): number return popup_create([], { border: [1, 1, 1, 1], close: 'click', minheight: 1, maxheight: 10, scrollbar: true, minwidth: &columns - 5, maxwidth: &columns - 5, }) enddef var id = Popup() echo id popup_settext(id, repeat(['abcd'], 20))
:call popup_settext(1001, [])
. The popup becomes empty and with minimum height.:call popup_settext(1001, ['a', 'b', 'c'])
The height of the popup does not change at step 4.
I would expect the popup to resize at step 4 to fit the new content. That is what happens if scrolling (step 2) is skipped when performing the above.
9.1.405
macOS 14.4.1
Apple Terminal
xterm-256color
ZSH 5.9
No response
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
If I scroll with mouse after step 4, window height increases.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
That's right, scrolling down restores the correct height. But scrolling should not be necessary. If you repeat the steps above skipping step 2, at step 4 the height is restored at once, as expected. I would expect that any call to popup_settext()
adapts the popup height (within the minheight
/maxheight
limits) regardless of the cursor's position.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.