PowerShell icon indicating copy to clipboard operation
PowerShell copied to clipboard

Else Indentation Issue

Open bcrotty opened this issue 11 years ago • 1 comments

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.

bcrotty avatar Mar 03 '15 16:03 bcrotty

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

keith-hall avatar Oct 02 '17 08:10 keith-hall