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

Enter when in a if-line #85

Open
PsywolfTheEnder opened this issue May 19, 2021 · 1 comment
Open

Enter when in a if-line #85

PsywolfTheEnder opened this issue May 19, 2021 · 1 comment
Labels
indentation pull requests welcome PRs will be reviewed, but maintainers will not fix.

Comments

@PsywolfTheEnder
Copy link

PsywolfTheEnder commented May 19, 2021

Let's us enter in a code line like Pycharm IDE
It's should be looks like the right side of the image

Capture

@kbrose
Copy link
Owner

kbrose commented May 19, 2021

Hello @PsywolfTheEnder, thank you for opening the issue. I think this is also related to #65.

I'd probably accept an MR that accomplishes this, but I'm sorry to say I likely won't be putting in the effort to accomplish this. Here's my understanding of what would have to change, for what it's worth:

  1. The handling of backslash continuations (which is missing from the left-hand image by the way) currently blindly indents the next line. See backlash detection and handling of partial indentations. This would have to be updated to know that it's the continuation of a specific kind of line (an if, def, else, etc. line) -- some sort of double-indent line?
  2. The handling of if/def/else/etc. keywords also relies on the detection of a colon, and then indents the next line accordingly with special handling to know that if a colon occurs after a closing bracket, then the indentation level should be relative to wherever the bracket was opened.

@kbrose kbrose added pull requests welcome PRs will be reviewed, but maintainers will not fix. indentation labels May 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
indentation pull requests welcome PRs will be reviewed, but maintainers will not fix.
Projects
None yet
Development

No branches or pull requests

2 participants