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

gh-111201: auto-indentation in _pyrepl #119348

Merged
merged 2 commits into from
May 22, 2024
Merged

Conversation

wiggin15
Copy link
Contributor

@wiggin15 wiggin15 commented May 21, 2024

Auto-indent blocks in new _pyrepl when the user presses after a line that should start a new block. By default, indent by 4 spaces, but keep the user indentation if the user changes it.

Ideas for future improvement (not included in this PR):

  • Add configuration to specify default number of spaces
  • Better parsing of latest line to support auto indentation after lines like this: if foo: # bar (currently it will not auto-indent after this line)

@bedevere-app bedevere-app bot mentioned this pull request May 21, 2024
7 tasks
@ambv ambv added skip news topic-repl Related to the interactive shell labels May 21, 2024
@ambv ambv force-pushed the pyrepl-auto-indent branch from 5090e05 to ac4a8a5 Compare May 22, 2024 02:51
@wiggin15
Copy link
Contributor Author

Hi @ambv , I see the commit authorship changed for the first commit 😬

@ambv ambv merged commit cd516cd into python:main May 22, 2024
39 checks passed
@ambv
Copy link
Contributor

ambv commented May 22, 2024

We squash all commits so this isn't important. As you can see in cd516cd the merged commit is attributed to you.

@ambv
Copy link
Contributor

ambv commented May 22, 2024

Thanks for your contribution, Arnon!

@lysnikolaou lysnikolaou added the needs backport to 3.13 bugs and security fixes label May 22, 2024
@miss-islington-app
Copy link

Thanks @wiggin15 for the PR, and @ambv for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Sorry, @wiggin15 and @ambv, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker cd516cd1f5e94dba887353f421513fd172efadf3 3.13

lysnikolaou pushed a commit to lysnikolaou/cpython that referenced this pull request May 22, 2024
(cherry picked from commit cd516cd)

Co-authored-by: Arnon Yaari <wiggin15@yahoo.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
lysnikolaou pushed a commit to lysnikolaou/cpython that referenced this pull request May 22, 2024
(cherry picked from commit cd516cd)

Co-authored-by: Arnon Yaari <wiggin15@yahoo.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
@bedevere-app
Copy link

bedevere-app bot commented May 22, 2024

GH-119427 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label May 22, 2024
ambv added a commit that referenced this pull request May 22, 2024
(cherry picked from commit cd516cd)

Co-authored-by: Arnon Yaari <wiggin15@yahoo.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
@wiggin15 wiggin15 deleted the pyrepl-auto-indent branch May 27, 2024 14:06
estyxx pushed a commit to estyxx/cpython that referenced this pull request Jul 17, 2024
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip news topic-repl Related to the interactive shell
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants