1
0
Fork 0

keybinding for dismissing autocompletelist (#1007)

* +added esc key to dismiss the autocomple list

* +added esc key to dismiss the autocomple list
This commit is contained in:
ಠ_ಠ 2019-02-13 01:18:32 +01:00 committed by Irina Truong
parent 484abb6530
commit bd0aaefdd2
3 changed files with 17 additions and 2 deletions

View File

@ -89,6 +89,7 @@ Contributors:
* Ignacio Campabadal
* Mikhail Elovskikh (wronglink)
* Marcin Cieślak (saper)
* easteregg
Creator:
--------

View File

@ -1,6 +1,11 @@
Upcoming:
=========
Features:
---------
* keybindings for closing the autocomplete list
Bug fixes:
----------
* Avoid error message on the server side if hstore extension is not installed in the current database (#991). (Thanks: `Marcin Cieślak`_)

View File

@ -41,6 +41,16 @@ def pgcli_bindings(pgcli):
else:
b.start_completion(select_first=True)
@kb.add('escape')
def _(event):
"""Force closing of autocompletion."""
_logger.debug('Detected <Esc> key.')
event.current_buffer.complete_state = None
event.app.current_buffer.complete_state = None
@kb.add('c-space')
def _(event):
"""
@ -71,7 +81,6 @@ def pgcli_bindings(pgcli):
_logger.debug('Detected enter key.')
event.current_buffer.complete_state = None
b = event.app.current_buffer
b.complete_state = None
event.app.current_buffer.complete_state = None
return kb