2

I have the following code:

let text = range(50)->map({_,i -> string(i)})
let winid = popup_create(text, {
    \ 'line': 1,
    \ 'col': 1,
    \ 'minwidth': 1,
    \ 'minheight': 1,
    \ 'cursorline': 1,
    \ 'wrap': 0,
    \ 'mapping': 0,
    \ 'filter': 'popup_filter_menu',
    \ 'firstline': 1,
    \ })

Which create a popup window on the side of the screen (left side depending on how you place yourself) and list a range of numbers, between 1 to 50.

The scrolling however, does not continue after the number 34 (where it is supposed to scroll down to 35, etc)

Any ways to make the scrolling work as intended?

2

Try to limit the height of the popup, at least 1 line less than the height of the terminal window, by including this key in the options dictionary passed to popup_create():

maxheight: &lines - 1

For example:

call range(50)
    \ ->map({_, i -> string(i)})
    \ ->popup_create(#{
    \     line: 1,
    \     col: 1,
    \     minwidth: 1,
    \     minheight: 1,
    \     maxheight: &lines - 1,
    \     cursorline: 1,
    \     wrap: 0,
    \     mapping: 0,
    \     filter: 'popup_filter_menu',
    \     firstline: 1,
    \     })
| improve this answer | |
  • 1
    This works great! seems it also fix a problem i had when scrolling up too :D. Cheers. – Nordine Lotfi Sep 15 at 20:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.