summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Slenders <jonathan@slenders.be>2015-07-30 22:16:08 +0200
committerJonathan Slenders <jonathan@slenders.be>2015-07-31 09:40:59 +0200
commit436dddd3b2107ead006755cdc2314f3edb3b7cac (patch)
tree42025fcceece6658f865dc25672513fdab7d0a86
parent8dfff69ec23be828d5681fae5fcd2c7b9391ced6 (diff)
Integration with prompt_toolkit==0.45
-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 29dddddd..2d123a2b 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 53370456..05dff0cb 100644
--- a/setup.py
+++ b/setup.py
@@ -25,7 +25,7 @@ setup(
install_requires=[
'click >= 3.2',
'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'