[vim/vim] proposal: allow popup col/line relative to the mouse position (#7645)

22 views
Skip to first unread message

Pontus Leitzler

unread,
Jan 9, 2021, 9:31:38 AM1/9/21
to vim/vim, Subscribed

Is your feature request about something that is currently impossible or hard to do? Please describe the problem.

I would like to create popups at the mouse pointer.

Describe the solution you'd like

The second argument to popup_create() is options where line and col can be specified as either a number, or the word cursor (and number as cursor+1 or cursor-1).

I would like to be able to also use mouse / mouse-1 / mouse+1 the same way, to create the popup relative to the mouse pointer.

Describe alternatives you've considered

n/a

Additional context

In the Go plugin govim we are currently a hover popup, where the user can alter options passed to popup_create().

Since there is no way to set col & line relative to the mouse cursor we manually add the position inside the plugin. This solution would let the user specify options that are passed through verbatim to vim, and that way set an absolute position for the popup. Something that isn't possible today.


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

Bram Moolenaar

unread,
Jan 9, 2021, 10:35:29 AM1/9/21
to vim/vim, Subscribed

Is there a reason you can't use getmousepos() ?

puremo...@gmail.com

unread,
Jan 10, 2021, 5:32:16 AM1/10/21
to vim_dev
Or popup_beval ?

Pontus Leitzler

unread,
Jan 11, 2021, 1:48:41 PM1/11/21
to vim/vim, Subscribed

The user provides a dict that I would like to pass verbatim to each popup_create() call.

If I understand it correctly (please correct me if I don't) I can't set a value in a straight-forward way so that it is re-evaluated each call, similar to cursor works in practice (or is that only convenience for getcurpos()?).

Reply all
Reply to author
Forward
0 new messages