Using popup windows instead of balloons

40 views
Skip to first unread message

Paul Jolly

unread,
Jun 6, 2019, 11:03:53 AM6/6/19
to vim...@googlegroups.com
Hi all,

As a follow up to a thread I just started ("Using text properties to
show rendered documents" -
https://groups.google.com/forum/#!topic/vim_dev/Armm3XaIleo) I'd like
to ask whether folks would be supportive of using popup windows
instead of balloons (or at least having this as an option).

Reason being, this gives us far greater flexibility in terms of
what/how we show when the mouse hovers over something.

Any thoughts?

Many thanks,


Paul

Bram Moolenaar

unread,
Jun 6, 2019, 1:03:41 PM6/6/19
to vim...@googlegroups.com, Paul Jolly
What part of balloons? If you mean 'balloonexpr', it only returns plain
text. Perhaps you mean the functionality to detect the mouse pointer is
hovering over text for some time? Well, we could add 'balloonpopup',
which would open a popup window with anything it likes and return the
window ID. That window would then be closed when the mouse moves.

--
Contrary to popular belief, Unix is user friendly.
It just happens to be selective about who it makes friends with.
-- Dave Parnas

/// 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 ///

Paul Jolly

unread,
Jun 6, 2019, 2:41:45 PM6/6/19
to Bram Moolenaar, vim...@googlegroups.com
> What part of balloons? If you mean 'balloonexpr', it only returns plain
> text. Perhaps you mean the functionality to detect the mouse pointer is
> hovering over text for some time? Well, we could add 'balloonpopup',
> which would open a popup window with anything it likes and return the
> window ID. That window would then be closed when the mouse moves.

I think what you propose 'balloonpopup' is exactly what I'm looking
for, thank you.

Essentially I'd like to leverage the fact that gopls (the LSP server
used by govim) can return a richer markdown version of hover
information. Being able to display a popup window instead of a balloon
will (via text properties etc) allow me to do just that.

One other thing to mention: I think we would want a cursor movement to
dismiss such a popup, in addition to a mouse move.

Similarly, I think we will need one of the options to popup_create to
allow for 'moved' property to also include mouse movement. Reason
being, I'd like the user to be able to trigger exactly the same hover
information via a mapping, displaying the popup at the cursor position
(not the mouse position). Just as described above, a mouse movement or
cursor movement should dismiss such a popup.

Thanks
Reply all
Reply to author
Forward
0 new messages