Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide autocompletion and calltip popups when code scrolled #3560

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

techee
Copy link
Member

@techee techee commented Sep 24, 2023

When autocompletion or calltip popup is displayed and the user scrolls the editor window (e.g. using a mouse wheel), these popups are still displayed and become detached from the original point which is quite ugly.

We can just simply dismiss them when the window scrolls.

When autocompletion or calltip popup is displayed and the user scrolls
the editor window (e.g. using a mouse wheel), these popups are still
displayed and become detached from the original point which is quite
ugly.

We can just simply dismiss them when the window scrolls.
@kugel-
Copy link
Member

kugel- commented Sep 24, 2023

LGBI

@elextr
Copy link
Member

elextr commented Sep 24, 2023

IIRC there are flags that autocomplete and/or calltip is shown, do any of those need to be cleared when they are cancelled?

@techee
Copy link
Member Author

techee commented Sep 24, 2023

IIRC there are flags that autocomplete and/or calltip is shown, do any of those need to be cleared when they are cancelled?

Good point, I've been fighting this in the last couple of days in the (not-yet-ready-to-be-published-but-soon-hopefully) LSP plugin.

For the calltip, there's no Scintilla notification informing that it got hidden so we can't even track its status and set some flags based on it (such a notification would be useful though, I'll try to ask Neil if it could be added).

For the autocomplete popup, there is SCN_AUTOCCANCELLED where autocomplete_scope_shown is set to FALSE. Unfortunately, this notification is a little strange and is only fired when the user cancels the popup (e.g. using escape) but isn't delivered when the popup disappears because the written word isn't in the autocompletion list any more. So we'd better not rely on it much (and add a fat comment under SCN_AUTOCCANCELLED). Fortunately, the autocomplete_scope_shown variable is more like

the_previous_autocomplete_popup_was_for_scope_autocompletion_and_not_for_normal_autocompletion

and it doesn't matter whether it's shown or not.

So I think in general this patch should be OK. Anyway, when playing with the LSP plugin I couldn't resist and rewrote the calltip code a bit because right now it doesn't re-appear when it should.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants