[vim/vim] Popup window does not resize any longer after scrolling (Issue #14745)

10 views
Skip to first unread message

Lifepillar

unread,
May 10, 2024, 5:42:26 PMMay 10
to vim/vim, Subscribed

Steps to reproduce

  1. Run vim --clean
  2. Source this script and take note of the reported popup id (let's say it's 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))
  1. With the mouse, scroll down the popup. This step is crucial to reproduce the issue!
  2. Execute :call popup_settext(1001, []). The popup becomes empty and with minimum height.
  3. Execute :call popup_settext(1001, ['a', 'b', 'c'])

The height of the popup does not change at step 4.

Expected behaviour

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.

Version of Vim

9.1.405

Environment

macOS 14.4.1
Apple Terminal
xterm-256color
ZSH 5.9

Logs and stack traces

No response


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/14745@github.com>

Maxim Kim

unread,
Jun 14, 2024, 8:54:42 AM (13 days ago) Jun 14
to vim/vim, Subscribed

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.Message ID: <vim/vim/issues/14745/2167975420@github.com>

Lifepillar

unread,
Jun 15, 2024, 3:37:56 PM (12 days ago) Jun 15
to vim/vim, Subscribed

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.Message ID: <vim/vim/issues/14745/2170592827@github.com>

Reply all
Reply to author
Forward
0 new messages