summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmjith Ramanujam <amjith.r@gmail.com>2015-08-02 14:42:05 -0700
committerAmjith Ramanujam <amjith.r@gmail.com>2015-08-02 14:42:05 -0700
commit47c9af815d062e4c1c5bd0750246b3c28cf740ec (patch)
tree7a46a299ad5dee41dc00ac0470e61291a52374a7
parenta25dc906afb675a2b9d9095553be05df84153459 (diff)
parent436dddd3b2107ead006755cdc2314f3edb3b7cac (diff)
Merge pull request #308 from jonathanslenders/prompt_toolkit_0.44
Integration with prompt_toolkit==0.44
-rw-r--r--pgcli/key_bindings.py1
-rwxr-xr-xpgcli/main.py2
-rw-r--r--pgcli/pgbuffer.py3
-rw-r--r--pgcli/pgclirc4
-rw-r--r--setup.py2
5 files changed, 10 insertions, 2 deletions
diff --git a/pgcli/key_bindings.py b/pgcli/key_bindings.py
index 90314324..508ed0b1 100644
--- a/pgcli/key_bindings.py
+++ b/pgcli/key_bindings.py
@@ -13,6 +13,7 @@ def pgcli_bindings(get_vi_mode_enabled, set_vi_mode_enabled):
assert callable(set_vi_mode_enabled)
key_binding_manager = KeyBindingManager(
+ enable_open_in_editor=True,
enable_vi_mode=Condition(lambda cli: get_vi_mode_enabled()))
@key_binding_manager.registry.add_binding(Keys.F2)
diff --git a/pgcli/main.py b/pgcli/main.py
index 1325a53a..6e9dc1a1 100755
--- a/pgcli/main.py
+++ b/pgcli/main.py
@@ -71,6 +71,7 @@ class PGCli(object):
self.pgspecial.timing_enabled = c['main'].as_bool('timing')
self.table_format = c['main']['table_format']
self.syntax_style = c['main']['syntax_style']
+ self.display_completions_in_columns = c['main'].as_bool('display_completions_in_columns')
self.logger = logging.getLogger(__name__)
self.initialize_logging()
@@ -241,6 +242,7 @@ class PGCli(object):
reserve_space_for_menu=True,
get_prompt_tokens=prompt_tokens,
get_bottom_toolbar_tokens=get_toolbar_tokens,
+ display_completions_in_columns=self.display_completions_in_columns,
extra_input_processors=[
# Highlight matching brackets while editing.
ConditionalProcessor(
diff --git a/pgcli/pgbuffer.py b/pgcli/pgbuffer.py
index 2687a5f6..9e41d5d3 100644
--- a/pgcli/pgbuffer.py
+++ b/pgcli/pgbuffer.py
@@ -10,7 +10,8 @@ class PGBuffer(Buffer):
doc = self.document
return self.always_multiline and not _multiline_exception(doc.text)
- super(self.__class__, self).__init__(*args, is_multiline=is_multiline, **kwargs)
+ super(self.__class__, self).__init__(*args, is_multiline=is_multiline,
+ tempfile_suffix='.sql', **kwargs)
def _multiline_exception(text):
text = text.strip()
diff --git a/pgcli/pgclirc b/pgcli/pgclirc
index 080fc57b..dbcd12a1 100644
--- a/pgcli/pgclirc
+++ b/pgcli/pgclirc
@@ -5,6 +5,10 @@
# possible completions will be listed.
smart_completion = True
+# Display the completions in several columns. (More completions will be
+# visible.)
+display_completions_in_columns = False
+
# Multi-line mode allows breaking up the sql statements into multiple lines. If
# this is set to True, then the end of the statements must have a semi-colon.
# If this is set to False then sql statements can't be split into multiple
diff --git a/setup.py b/setup.py
index 64fa8c86..357783f6 100644
--- a/setup.py
+++ b/setup.py
@@ -25,7 +25,7 @@ setup(
install_requires=[
'click >= 4.1',
'Pygments >= 2.0', # Pygments has to be Capitalcased. WTF?
- 'prompt_toolkit==0.42',
+ 'prompt_toolkit==0.45',
'psycopg2 >= 2.5.4',
'sqlparse == 0.1.14',
'configobj >= 5.0.6'