-
Notifications
You must be signed in to change notification settings - Fork 352
indent after one-line if statement without semicolon #291
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
Comments
Oh man, I have a feeling this one is going to be absurdly difficult to solve. Thanks for the report. |
Admittedly I am not familiar with the code, but shouldn't this be pretty simple? If there is anything after the parenthesis, then that is the if block and the next line is not. |
I decided to get my hands dirty. Looking at The problem is that |
Thanks for the detective work, @cambunctious! Using regexes for this stuff makes me throw up in my mouth a bit, but unless/until we can make use of the underlying syntax groups to do this stuff, it's pretty unavoidable... I have a knack for vim regex so I'll take a crack at getting something in place that won't break under the smallest amount of pressure, and hopefully we'll be able to put this to bed for now. |
Also, with regard to:
Corner cases. Consider the following: if (something) { doLittle(); } else
bigNamedVariable.doTonsOfStuffHolyCrapThisMethodNameIsSoConvenientlyDescriptive(); I don't have a very good idea of how all those indent-related functions operate, but I assume that cases like the above could throw it for a loop. We can ignore those cases, but only until somebody posts an issue here complaining that it doesn't work. =P |
Blast! Maybe
I see the tricky part is the parenthetical with regex. Is it possible to use the |
I will have to take a look at it, but using normal commands/moving the On Tue, 1 Sep 2015 17:11 Cameron Steffen [email protected] wrote:
|
Just faced this problem. I've never used regular expressions in vimscript before, so I'm almost sure that my solution is completely wrong and dirty, but it seems to work for me for now (tested for a few seconds lol)
|
I already have a pull request submitted for this. |
Issue #291 better one line scope indentation
This is incorrectly indented
The text was updated successfully, but these errors were encountered: