From 8b1d1c0234e0ef739be17373f42fd50960d17a94 Mon Sep 17 00:00:00 2001 From: ryneeverett Date: Wed, 14 Dec 2016 23:35:10 -0500 Subject: [PATCH 1/2] Eliminate extra validation after two newlines. Even after [the latest python-prompt-toolkit commit](https://github.com/jonathanslenders/python-prompt-toolkit/commit/43a52365cc99ceb71c5f7bc815525d03140d75fd) validation occurs twice here, because rstripping the buffer resets the `validation_state`. I don't see any behavioral differences from dropping the initial validation altogether. --- ptpython/key_bindings.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/ptpython/key_bindings.py b/ptpython/key_bindings.py index 38186891..9cfceb64 100644 --- a/ptpython/key_bindings.py +++ b/ptpython/key_bindings.py @@ -105,14 +105,13 @@ def at_the_end(b): elif at_the_end(b) and b.document.text.replace(' ', '').endswith( '\n' * (empty_lines_required - 1)): - if b.validate(): - # When the cursor is at the end, and we have an empty line: - # drop the empty lines, but return the value. - b.document = Document( - text=b.text.rstrip(), - cursor_position=len(b.text.rstrip())) - - b.accept_action.validate_and_handle(event.cli, b) + # When the cursor is at the end, and we have an empty line: + # drop the empty lines, but return the value. + b.document = Document( + text=b.text.rstrip(), + cursor_position=len(b.text.rstrip())) + + b.accept_action.validate_and_handle(event.cli, b) else: auto_newline(b) From f33d1684b386fbd5099a23f3469ad3225597036f Mon Sep 17 00:00:00 2001 From: ryneeverett Date: Wed, 14 Dec 2016 23:56:12 -0500 Subject: [PATCH 2/2] Remove pypy3 from travis. See . --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 02853d77..adc2c4ec 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,6 @@ env: - TOXENV=py33 - TOXENV=py34 - TOXENV=pypy - - TOXENV=pypy3 install: - travis_retry pip install tox script: