Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paste detection in bpython instead of Curtsies, fixes #575 #584

Merged
merged 5 commits into from Dec 11, 2015

Conversation

@thomasballinger
Copy link
Member

thomasballinger commented Dec 6, 2015

This switches from using curtsies-created paste events to creating paste events in bpython whenever 10 or more keypress events are queued up.

I think long term this is a good move because it's one less Curtsies-specific piece of input functionality, and I'd like to remove this feature from Curtsies and use Blessed for input code eventually because I trust @jquast to get it right more than I do myself. It's also better because now it helps the UI catch up any time it gets behind on events, e.g. from a fast typist on a slow machine, whereas before the bytes had to be read in the same system call to be considered a paste event. The paste threshold of 10 should be tuned for this, it should probably be much lower (2 or 3?).

If you don't like the combined_events coroutine I'd be happy to reimplement it as a class, I think that might be clearer but because the .send and next() interface was all we needed it seemed easy to write that way.

@thomasballinger thomasballinger force-pushed the paste-detection branch from 2498f63 to b1f22f5 Dec 6, 2015
@thomasballinger thomasballinger changed the title Paste detection in bpython instead of Curtsies Paste detection in bpython instead of Curtsies, fixing #575 Dec 6, 2015
@thomasballinger thomasballinger changed the title Paste detection in bpython instead of Curtsies, fixing #575 Paste detection in bpython instead of Curtsies, fixes #575 Dec 6, 2015
@sebastinas
Copy link
Contributor

sebastinas commented Dec 11, 2015

Sure

@thomasballinger
Copy link
Member Author

thomasballinger commented Dec 11, 2015

Great I'll merge it then

@thomasballinger thomasballinger merged commit fa08b74 into master Dec 11, 2015
1 check passed
1 check passed
continuous-integration/travis-ci/push The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.