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

Indentation when pressing o #121

Open
kuator opened this issue Jan 28, 2019 · 7 comments
Open

Indentation when pressing o #121

kuator opened this issue Jan 28, 2019 · 7 comments

Comments

@kuator
Copy link

kuator commented Jan 28, 2019

gif
Sorry in advance, I am noob. When I press o with cursor being on super() as you can see on gif,
it indents new line. But when I'm outside the method it keeps indenting it

@blueyed
Copy link
Member

blueyed commented Jan 29, 2019

What do you expect instead?

Should it behave different (i.e. indent by 4 to the "def") when there are two newlines in front already? (like with "return" in the last list of the method)

@kuator
Copy link
Author

kuator commented Jan 29, 2019

I guess, it would be better if when I press o while being on super() it indentds new line. But
if I go to the beginning of this new created line and press o it doesn't indent it.
another

@kuator kuator changed the title Indentation when pressing O Indentation when pressing o Jan 29, 2019
@kuator kuator changed the title Indentation when pressing o Indentation when pressing o Jan 29, 2019
@blueyed
Copy link
Member

blueyed commented Jan 29, 2019

Makes sense.

I think we can check &autoindent and keep the indent then.

Started working on it in #122.

blueyed added a commit to blueyed/vim-python-pep8-indent that referenced this issue Jan 29, 2019
@blueyed
Copy link
Member

blueyed commented Jan 29, 2019

Can you check the branch/patch from #122 (blueyed:autoindent-0), please?
(basically 106a918)

@blueyed
Copy link
Member

blueyed commented Jan 29, 2019

Not that trivial.. it fails for using cc on line 3 with:

def a():
    b

    c

The indent should be 4 here IMHO, but cc will keep the existing indent (0), which then gets kept when we return -1.

I am also not sure about assuming that e.g. two previous blank lines should keep the indent from autoindent etc.

@kuator
Copy link
Author

kuator commented Jan 29, 2019

gif

@kuator
Copy link
Author

kuator commented Jan 29, 2019

Same

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

No branches or pull requests

2 participants