Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix pydruid.console prompt_toolkit + pygments integration #248

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions pydruid/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
from prompt_toolkit import prompt
from prompt_toolkit.completion.word_completer import WordCompleter
from prompt_toolkit.history import FileHistory
from prompt_toolkit.lexers import PygmentsLexer
from prompt_toolkit.styles.pygments import style_from_pygments_cls
from pygments.lexers import SqlLexer
from pygments.style import Style
from pygments.styles.default import DefaultStyle
Expand Down Expand Up @@ -170,9 +172,9 @@ def main():
try:
query = prompt(
"> ",
lexer=SqlLexer,
lexer=PygmentsLexer(SqlLexer),
completer=sql_completer,
style=DocumentStyle,
style=style_from_pygments_cls(DocumentStyle),
history=history,
)
except (EOFError, KeyboardInterrupt):
Expand Down