[vim/vim] Popup-balloons and ordinary balloons should not disappear when the mouse pointer moves onto them (Issue #11710)

16 views
Skip to first unread message

Shuangcheng-Ni

unread,
Dec 15, 2022, 12:30:05 PM12/15/22
to vim/vim, Subscribed

Is your feature request about something that is currently impossible or hard to do? Please describe the problem.
The balloons created by set balloonexpr or balloon_show and the popups created by popup_beval will disappear if the mouse pointer moves onto them, which makes it hard to scroll in such balloons or popups. Such kind of windows are often used to show documents related to the symbols under the mouse pointer. The document may be quite long, so it is necessary to enable users to scroll in such windows. Indeed, we can use commands like call win_execute(winid of the popup, "normal \<C-f>") or call win_execute(winid of the popup, "normal \<C-b>") to scroll down or up in popup-balloons. However, this method is too complicated and it is not usable in ordinary balloons.

Describe the solution you'd like
A popup-balloon should not disappear when the mouse pointer is inside it as well as in the range required by the mousemoved option. An ordinary balloon should also persist when the mouse pointer moves onto it.

Describe alternatives you've considered
Currently, the mousemoved option of popups is a list with screen row, minimum and maximum screen column, which means the range of screen row is restricted to a single line (i.e. v:beval_lnum). Is it possible to restrict the range of screen row to a range of lines? In this way, we just need to set the minimum screen row to the top screen line of the popup and set the maximum screen row to the bottom screen line of the popup.


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/11710@github.com>

Bram Moolenaar

unread,
Dec 15, 2022, 3:26:07 PM12/15/22
to vim/vim, Subscribed

The balloon doesn't get removed because the mouse pointer moves onto it, but because it moves away from the location where the balloon would show. What you propose it to keep the balloon showing even though the mouse has moved, if the mouse moved onto the balloon. This would be possible if the balloon shows right next to the text that the mouse is on.

For 'balloonexpr' I don't see a reason, there is no way to scroll the text.

For the popup_beval() case it already works, you can move the mouse inside the popup and scroll the text.


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/11710/1353666649@github.com>

Shuangcheng-Ni

unread,
Dec 16, 2022, 1:14:38 AM12/16/22
to vim/vim, Subscribed

Thanks a lot for your quick and helpful reply!

For me, the popup-balloon sometimes persists and sometimes disappears in the popup_beval case, which seems not so stable. I've upgraded my vim to the latest version and I'm using it in terminals. I cannot figure out whether it's my problem or the terminal vim's.

Besides, I think it's quite usual to use balloonexpr and popup_beval together.
For example,

func! GetDoc()
    call popup_beval('documents...', #{options...})
    return ''
endfunc

set balloonexpr=GetDoc()

In this case, the popup-balloon always disappears due to the use of balloonexpr.


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/11710/1354271889@github.com>

Shuangcheng-Ni

unread,
Jan 15, 2023, 5:52:12 AM1/15/23
to vim/vim, Subscribed

Closed #11710 as completed.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issue/11710/issue_event/8229246516@github.com>

Reply all
Reply to author
Forward
0 new messages