Skip to content

Fix autocompletion bar not hiding when escaping empty command bar - #1036

Open
SaadZahem wants to merge 2 commits into
pwmt:developfrom
SaadZahem:bug/stuck-autocompletion-#1035
Open

SaadZahem wants to merge 2 commits into
pwmt:developfrom
SaadZahem:bug/stuck-autocompletion-#1035

Conversation

@SaadZahem

Copy link
Copy Markdown

Fixes #1035

Root cause: in girara-gtk/completion.c, girara_isc_completion() starts with:

if (input_length == 0 || input[0] != ':') {
    return false;
}

This runs before the code that checks argument->n == GIRARA_HIDE and actually destroys/hides session->gtk.results. girara_isc_abort() (which Escape triggers via sc_abort → girara_sc_abort) calls girara_isc_completion() with GIRARA_HIDE to close the popup — but once you've backspaced the input bar down to nothing (even the leading : is gone), input_length == 0 and the function bails out immediately, so the hide logic never runs and the completion pane stays on screen.

Fix: let a GIRARA_HIDE request through regardless of the current input bar contents:

if ((input_length == 0 || input[0] != ':') && argument->n != GIRARA_HIDE) {
    return false;
}

I took time to build (zathura + zathura-pdf-mupdf) and test this on my arch linux machine.
Let me know if anything needs to be edited before a merge.

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.

Hitting Escape on an empty command bar doesn't hide the autocompletion pane

1 participant