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

Add python interactive else dedent #6653

Closed

Conversation

lucario387
Copy link
Contributor

@lucario387 lucario387 commented Apr 8, 2023

Python else statements were not dedented automatically, so adding a pattern to capture this case,

Example code:

def test():
    if True:
        print("Ok")
        else: # After pressing ":", the line will become
    else:

Copy link
Member

@the-mikedavis the-mikedavis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any behavior change with this change to the indent query. As far as I know, automatic dedent is not currently implemented

@lucario387 lucario387 marked this pull request as draft April 8, 2023 23:30
@lucario387
Copy link
Contributor Author

lucario387 commented Apr 8, 2023

I don't see any behavior change with this change to the indent query.

Sorry, I didn't test it enough. I was trying to mimic the behavior of vim-python-pep8-indent

As far as I know, automatic dedent is not currently implemented

Does this mean indent calculation for each line is only done on pressing and not while typing?

@kirawi
Copy link
Member

kirawi commented Apr 9, 2023

It would require #6044 to be implemented.

@lucario387
Copy link
Contributor Author

lucario387 commented Apr 9, 2023

I see. Thanks for the explanation

Is it okay for me to park this PR and wait till #6044 or its equivalences is implemented?

@pickfire
Copy link
Contributor

I think we can close this for now given that when that PR is done most likely the python support have already been added.

@pickfire pickfire closed this Apr 13, 2023
@lucario387 lucario387 deleted the python-else-dedent branch April 13, 2023 02:23
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.

4 participants