Skip to content

gh-122237: Fix REPL wrong auto-indentation with comments - #122238

Closed
HarryLHW wants to merge 1 commit into
python:mainfrom
HarryLHW:repl-autoindent
Closed

HarryLHW wants to merge 1 commit into
python:mainfrom
HarryLHW:repl-autoindent

Conversation

@HarryLHW

@HarryLHW HarryLHW commented Jul 24, 2024 •

Copy link
Copy Markdown
Contributor
@HarryLHW

Copy link
Copy Markdown
Contributor Author

At this point, it will never auto-indent if there is only a comment without other code in the last line. This will produce the following situation, and I am trying to fix that if possible.
image

@JeffersGlass

Copy link
Copy Markdown
Contributor

At this point, it will never auto-indent if there is only a comment without other code in the last line. This will produce the following situation, and I am trying to fix that if possible.

For what it’s worth, I’m not sure I would consider this a bug. Presumably, the user had to un-indent the comment line deliberately, so I would expect the following line to also be un-indented, if that makes sense.

Are there other situations where this behavior leads to incorrect indentation?

@ambv

ambv commented Oct 23, 2024

Copy link
Copy Markdown
Contributor

This is fixed already.

@ambv ambv closed this Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants