Skip to content

Commit

Permalink
Access the current line directly from the Document instance instead o…
Browse files Browse the repository at this point in the history
…f calculating it manually
  • Loading branch information
Artur Balabanov committed Jul 29, 2018
1 parent 3cef794 commit 7717040
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions pgcli/key_bindings.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,7 @@ def _(event):
buff = event.cli.current_buffer
doc = buff.document

line_start = doc.cursor_position + doc.get_start_of_line_position()
line_end = doc.cursor_position + doc.get_end_of_line_position()
current_line = doc.text[line_start:line_end]

if current_line.strip():
if doc.current_line.strip():
if buff.complete_state:
buff.complete_next()
else:
Expand Down

0 comments on commit 7717040

Please sign in to comment.