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. You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/3560
-- Commit Summary --
* Hide autocompletion and calltip popups when code scrolled
-- File Changes --
M src/editor.c (6)
-- Patch Links --
https://github.com/geany/geany/pull/3560.patch https://github.com/geany/geany/pull/3560.diff
LGBI
IIRC there are flags that autocomplete and/or calltip is shown, do any of those need to be cleared when they are cancelled?
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.
@techee pushed 1 commit.
12f56701eff1a8ac504fff7d0cfc4998811c05f7 Hide autocompletion and calltip popups when code scrolled
I didn't merge this PR last year because it was just before the release but I think the patch is safe and shouldn't cause any harm (I'm doing the same with the LSP plugin without any problems) so I'm merging it now.
Merged #3560 into master.
github-comments@lists.geany.org