summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIrina Truong <i.chernyavska@gmail.com>2017-02-25 14:23:35 -0800
committerGitHub <noreply@github.com>2017-02-25 14:23:35 -0800
commit9cc58b7087eb31eb1ca142a0fe4cab7814b43437 (patch)
treedfa4daf8ebc0c262a810d9bf21347dd8daec3af5
parentb07d63be4c5cdc53f008575cdbda67b310a2eebf (diff)
parentfe44cd4b3732bf3e927e196d03457fed3cfe1686 (diff)
Merge pull request #642 from dbcli/darikg/reserve-more-menu-space
User config to reserve more menu space
-rwxr-xr-xpgcli/main.py4
-rw-r--r--pgcli/pgclirc3
2 files changed, 6 insertions, 1 deletions
diff --git a/pgcli/main.py b/pgcli/main.py
index 0cd0d1ab..b09ca74e 100755
--- a/pgcli/main.py
+++ b/pgcli/main.py
@@ -132,6 +132,7 @@ class PGCli(object):
else:
self.row_limit = c['main'].as_int('row_limit')
+ self.min_num_menu_lines = c['main'].as_int('min_num_menu_lines')
self.table_format = c['main']['table_format']
self.syntax_style = c['main']['syntax_style']
self.cli_style = c['colors']
@@ -142,6 +143,7 @@ class PGCli(object):
self.on_error = c['main']['on_error'].upper()
self.decimal_format = c['data_formats']['decimal']
self.float_format = c['data_formats']['float']
+
self.completion_refresher = CompletionRefresher()
self.query_history = []
@@ -511,7 +513,7 @@ class PGCli(object):
layout = create_prompt_layout(
lexer=PygmentsLexer(PostgresLexer),
- reserve_space_for_menu=4,
+ reserve_space_for_menu=self.min_num_menu_lines,
get_prompt_tokens=prompt_tokens,
get_continuation_tokens=get_continuation_tokens,
get_bottom_toolbar_tokens=get_toolbar_tokens,
diff --git a/pgcli/pgclirc b/pgcli/pgclirc
index 96b37d62..e0adffe3 100644
--- a/pgcli/pgclirc
+++ b/pgcli/pgclirc
@@ -110,6 +110,9 @@ less_chatty = False
# \n - Newline
prompt = '\u@\h:\d> '
+# Number of lines to reserve for the suggestion menu
+min_num_menu_lines = 4
+
# Custom colors for the completion menu, toolbar, etc.
[colors]
Token.Menu.Completions.Completion.Current = 'bg:#ffffff #000000'