1
0
Fork 0

Add fish-style autosuggestion.

This commit is contained in:
Amjith Ramanujam 2017-07-16 15:06:25 -07:00
parent 69daf3ae0c
commit 925341cbce
3 changed files with 12 additions and 1 deletions

View File

@ -1,7 +1,15 @@
Upcoming
========
TBD
Features:
---------
* Add fish-style auto-suggestion from history. (Thanks: `Amjith Ramanujam`_)
Bug Fixes:
----------
There are no bugs :)
1.7.0
=====

View File

@ -18,6 +18,7 @@ def pgcli_bindings(get_vi_mode_enabled, set_vi_mode_enabled):
key_binding_manager = KeyBindingManager(
enable_open_in_editor=True,
enable_system_bindings=True,
enable_auto_suggest_bindings=True,
enable_search=True,
enable_abort_and_exit_bindings=True)

View File

@ -34,6 +34,7 @@ from prompt_toolkit.layout.lexers import PygmentsLexer
from prompt_toolkit.layout.processors import (ConditionalProcessor,
HighlightMatchingBracketProcessor)
from prompt_toolkit.history import FileHistory
from prompt_toolkit.auto_suggest import AutoSuggestFromHistory
from pygments.lexers.sql import PostgresLexer
from pygments.token import Token
@ -563,6 +564,7 @@ class PGCli(object):
with self._completer_lock:
buf = PGBuffer(
auto_suggest=AutoSuggestFromHistory(),
always_multiline=self.multi_line,
multiline_mode=self.multiline_mode,
completer=self.completer,