pgcli
pgcli copied to clipboard
Non-multi line mode isn't working well
Description
Related to #1109
Issue is in master branch.
When I have the completion menu open it is not acknowledging the enter key. C-n and C-p to select items from the completion menu are also broken.
You fixed the enter issue (#1114) - thanks!
Just to record my findings for the other issue: it looks like the C-n/C-p issue is related to/caused by https://github.com/dbcli/pgcli/commit/19c3e0eeb81f4a231d0ebfd2c18c47215f85e572#diff-8c7ffac5f775dfaf49268b59aba8bd78R108 - if I comment those bindings, C-n/C-p selects items in the completion menu, but now longer selects history. I don't know what a "selection" is to prompt_toolkit, but perhaps the filters should be ~has_completions instead (with 5s of testing it seems to work like that). I'll try and create a PR soon
has_selection is meant to return true when the user has selected an item from the menu.
This is to ensure if the user is trying to select an item from the completion menu then C-n and C-p has to move up and down the menu, but if they haven't selected any items from the completion menu then C-n and C-p should move up and down the history.
The completion menu is almost always open, so having ~has_completions as a condition will force the C-n and C-p to navigate the menu instead of history.
I wonder if has_selection behavior has changed recently.