[vim/vim] Can there be an option to scroll a popup along with the buffer? (#4560)

54 views
Skip to first unread message

Andy Massimino

unread,
Jun 18, 2019, 5:37:56 PM6/18/19
to vim/vim, Subscribed

Many plugins would like to annotate the buffer using a popup, but when the user scrolls, it is difficult to react. I would say popup_atcursor should follow the cursor when using <c-y>/<c-e>.
I think when the position goes off the screen the popup should exist but not be drawn until that position is on-screen again. Or perhaps the popup can be hidden or close optonally.

call popup_create(['foo'], {'scroll': 1})

Maybe this would be better as "buffer-positioned" popups instead of screen-positioned?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub

Bram Moolenaar

unread,
Jun 19, 2019, 10:35:22 AM6/19/19
to vim/vim, Subscribed

> Many plugins would like to annotate the buffer using a popup, but when
> the user scrolls, it is difficult to react. I would say
> `popup_atcursor` should follow the cursor when using `<c-y>/<c-e>`.
> I think when the position goes off the screen the popup should exist
> but not be drawn until that position is on-screen again. Or perhaps
> the popup can be hidden or close optonally.
>
> ```vim

> call popup_create(['foo'], {'scroll': 1})
> ```
>
> Maybe this would be better as "buffer-positioned" popups instead of
> screen-positioned?

I suppose it's not just scrolling, but also inserting/deleting lines.
Thus it would be more like how a text property sticks to a certain
position. Not sure how much that is to implement...

--
hundred-and-one symptoms of being an internet addict:
240. You think Webster's Dictionary is a directory of WEB sites.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Bram Moolenaar

unread,
Aug 25, 2019, 4:25:36 PM8/25/19
to vim/vim, Subscribed

Closed #4560 via 12034e2.

Ben Jackson

unread,
Aug 26, 2019, 8:16:21 AM8/26/19
to vim_dev
Very nice! Thanks! I had a bunch of fiddly code to approximate this.
Reply all
Reply to author
Forward
0 new messages