summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmjith Ramanujam <amjith@newrelic.com>2014-12-13 13:43:32 -0800
committerAmjith Ramanujam <amjith@newrelic.com>2014-12-13 13:43:32 -0800
commit5009bd5ac09b65304b20e0d6ff369feba55875a6 (patch)
tree2681648ff35d58dcb343c618357a663b49fcce5c
parentda4e08d1c1d7645be4e68404cf94644bbf6fede3 (diff)
Add middle of the line completion.
-rw-r--r--pgcli/pgcompleter.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/pgcli/pgcompleter.py b/pgcli/pgcompleter.py
index 44d11267..e50edf8c 100644
--- a/pgcli/pgcompleter.py
+++ b/pgcli/pgcompleter.py
@@ -78,11 +78,11 @@ class PGCompleter(Completer):
# will always be the partially typed string which renders the smart
# completion useless because it will always return the list of keywords
# as completion.
-
if word_before_cursor:
- parsed = sqlparse.parse(document.text[:-len(word_before_cursor)])
+ parsed = sqlparse.parse(
+ document.text_before_cursor[:-len(word_before_cursor)])
else:
- parsed = sqlparse.parse(document.text)
+ parsed = sqlparse.parse(document.text_before_cursor)
last_token = ''
if parsed: