-
Notifications
You must be signed in to change notification settings - Fork 13
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
Incorrect auto-indenting after decorator line? #41
Comments
Yeah, this is due to a bit of goofiness in the way block matching works. Decorators are seen as part of the function, so it's correctly (questionable) indenting what it thinks is the function body. It should autocorrect the indent when you complete the function signature with |
@tweekmonster yeah I'm not sure I follow.
@pytest.fixture<ENTER>
| # <- that's the cursor...
@classmethod
def my_func(cls):
pass A decorator is more like a function call no? def decorator(**kwargs):
def wrapper(*args):
func(*args, **kwargs)
return wrapper
decorator()<ENTER> will take you to the next line as expected. It seems that only when a @decorator(doggy='dirty')<ENTER>
def...
Yeah that just seems confusing to me because why should they be seen that way? You're right though the |
What I meant by it being questionably correct is that a decorator is part of the function's block (as far as It is unintuitive. But, I don't have time to dig deep into it right now. If you want to delve into it, you'll want to look at Something else I noticed is that if you press A little off topic: I'm hoping that this progresses into something that'll allow me to create a much simpler version of braceless: neovim/neovim#6052. But, it most likely won't find it's way upstream to Vim. |
@tweekmonster cool sounds good. Not sure if I'll be able to dig any sooner then you but I appreciate at least getting this on the backlog 👍 |
Whenever I write out a decorator line and then hit enter braceless seems to increase the indent level:
This seems wrong; there should be not indent added - maybe I'm also wrong in guessing this is braceless's doing?
It seems to go away when I disable the plugin though...
The text was updated successfully, but these errors were encountered: