mirror of
https://github.com/dbcli/pgcli.git
synced 2024-09-11 13:56:36 +03:00
Allow configurable multiline continuation char
This commit is contained in:
parent
733a607380
commit
e5d3d5d63f
1
AUTHORS
1
AUTHORS
@ -56,6 +56,7 @@ Contributors:
|
||||
* Manuel Barkhau
|
||||
* Sergii V
|
||||
* Emanuele Gaifas
|
||||
* Owen Stephens
|
||||
|
||||
Creator:
|
||||
--------
|
||||
|
@ -4,6 +4,7 @@ Upcoming
|
||||
Features:
|
||||
---------
|
||||
* Suggest objects from all schemas (not just those in search_path) (Thanks: `Joakim Koljonen`_)
|
||||
* Allow configurable character to be used for multi-line query continuations. (Thanks: `Owen Stephens`_)
|
||||
|
||||
Bug fixes:
|
||||
----------
|
||||
@ -663,3 +664,4 @@ Improvements:
|
||||
.. _`Sergii`: https://github.com/foxyterkel
|
||||
.. _`Emanuele Gaifas`: https://github.com/lelit
|
||||
.. _`tk`: https://github.com/kanet77
|
||||
.. _`Owen Stephens`: https://github.com/owst
|
||||
|
@ -133,6 +133,7 @@ class PGCli(object):
|
||||
self.row_limit = c['main'].as_int('row_limit')
|
||||
|
||||
self.min_num_menu_lines = c['main'].as_int('min_num_menu_lines')
|
||||
self.multiline_continuation_char = c['main']['multiline_continuation_char']
|
||||
self.table_format = c['main']['table_format']
|
||||
self.syntax_style = c['main']['syntax_style']
|
||||
self.cli_style = c['colors']
|
||||
@ -508,7 +509,8 @@ class PGCli(object):
|
||||
return [(Token.Prompt, prompt)]
|
||||
|
||||
def get_continuation_tokens(cli, width):
|
||||
return [(Token.Continuation, '.' * (width - 1) + ' ')]
|
||||
continuation=self.multiline_continuation_char * (width - 1) + ' '
|
||||
return [(Token.Continuation, continuation)]
|
||||
|
||||
get_toolbar_tokens = create_toolbar_tokens_func(
|
||||
lambda: self.vi_mode, self.completion_refresher.is_refreshing,
|
||||
|
@ -116,6 +116,9 @@ prompt = '\u@\h:\d> '
|
||||
# Number of lines to reserve for the suggestion menu
|
||||
min_num_menu_lines = 4
|
||||
|
||||
# Character used to left pad multi-line queries to match the prompt size.
|
||||
multiline_continuation_char = '.'
|
||||
|
||||
# Custom colors for the completion menu, toolbar, etc.
|
||||
[colors]
|
||||
Token.Menu.Completions.Completion.Current = 'bg:#ffffff #000000'
|
||||
|
Loading…
Reference in New Issue
Block a user