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

Automatic matching of brackets and quotes #388

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mskar
Copy link

@mskar mskar commented Oct 3, 2020

This PR

  1. implements insertion and deletion of matched brackets and quotes
  2. makes changes to ptpython/key_bindings.py
  3. is similar to Update config.py to add auto close for brackets and parentheses #363, which only handles insertion (not deletion) and makes changes to config.py
  4. shamelessly borrows code from randy3k/radian

Example:

  1. Start ptpython
  2. Press (, [, {, ', or " to insert a pair of round/square/curly brackets or single/double quotes with the cursor inside
  3. Press backspace or ctrl h to delete the inserted bracket or quote pair

To install to version of ptpython in this pull request, run
python -m pip install git+https://github.com/mskar/ptpython.git@auto_match

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants