SublimeText / PowerShell

Support for the MS PowerShell programming language.
MIT License
313 stars 78 forks source link

Else Indentation Issue #107

Open bcrotty opened 9 years ago

bcrotty commented 9 years ago

2015-03-03 10_47_24-new issue sublimetext_powershell

The construction on the left breaks automatic indentation (in PowerShell only). It should look like the middle version after a Reindent, and the right version is a workaround. I'm not sure what's causing this or what ST uses to determine indentation.

else should be indented the same as the if above because it's not nested, and indenting it breaks indentation for anything below.

keith-hall commented 7 years ago

This package doesn't currently provide any indentation rules, so the ones from ST's Default package are used - and they don't cope with elseif, as you've experienced. There is some documentation for indentation rules at http://docs.sublimetext.info/en/latest/reference/metadata.html#indentation-options-children-of-settings.

It may be possible to borrow some rules from similar languages like C#, if anyone is interested in making a PR here: https://github.com/sublimehq/Packages/blob/2bc05081783362241cc0a46692a84a094ea5b9ec/C%23/Indentation.tmPreferences