diff options
author | Iryna Cherniavska <icherniavska@cars.com> | 2014-12-19 08:21:59 -0800 |
---|---|---|
committer | Iryna Cherniavska <icherniavska@cars.com> | 2014-12-19 08:21:59 -0800 |
commit | 2e64ba3e1f680a4d0264d3f95e56dbfa4cdc2523 (patch) | |
tree | a731206c48655bc07a2a6995799f0a756f9a1d52 | |
parent | e2877870456e0146380c3b3519cb1289e4f56a86 (diff) |
added binding on control-space; changed order to order by
-rw-r--r-- | pgcli/key_bindings.py | 9 | ||||
-rw-r--r-- | pgcli/pgcompleter.py | 2 |
2 files changed, 10 insertions, 1 deletions
diff --git a/pgcli/key_bindings.py b/pgcli/key_bindings.py index 949fa334..f4685758 100644 --- a/pgcli/key_bindings.py +++ b/pgcli/key_bindings.py @@ -1,4 +1,5 @@ from prompt_toolkit.keys import Keys +from prompt_toolkit.enums import InputMode def pgcli_bindings(registry, cli_ref): """ @@ -21,3 +22,11 @@ def pgcli_bindings(registry, cli_ref): """ #import pdb; pdb.set_trace() line.always_multiline = not line.always_multiline + + @handle(Keys.ControlSpace, in_mode=InputMode.INSERT) + @handle(Keys.ControlSpace, in_mode=InputMode.SELECTION) + def _(event): + """ + Force autocompletion at cursor + """ + line.complete_next() diff --git a/pgcli/pgcompleter.py b/pgcli/pgcompleter.py index 12727d50..2deb66a8 100644 --- a/pgcli/pgcompleter.py +++ b/pgcli/pgcompleter.py @@ -14,7 +14,7 @@ class PGCompleter(Completer): 'INTEGER', 'INTERSECT', 'INTO', 'IS', 'LEVEL', 'LIKE', 'LOCK', 'LONG', 'MAXEXTENTS', 'MINUS', 'MLSLABEL', 'MODE', 'MODIFY', 'NOAUDIT', 'NOCOMPRESS', 'NOT', 'NOWAIT', 'NULL', 'NUMBER', 'OF', - 'OFFLINE', 'ON', 'ONLINE', 'OPTION', 'OR', 'ORDER', 'PCTFREE', + 'OFFLINE', 'ON', 'ONLINE', 'OPTION', 'OR', 'ORDER BY', 'PCTFREE', 'PRIOR', 'PRIVILEGES', 'PUBLIC', 'RAW', 'RENAME', 'RESOURCE', 'REVOKE', 'ROW', 'ROWID', 'ROWNUM', 'ROWS', 'SELECT', 'SESSION', 'SET', 'SHARE', 'SIZE', 'SMALLINT', 'START', 'SUCCESSFUL', |