1
Vote

Don't indent bracketed content when adding newline immediately after the bracket

description

The XAML editor gets this behaviour better than we do (IMO):

a_list = [<newline here>
....<next line here>

a_list = [1, <newline here>
..........<next line here>


I don't know about other's coding styles, but having:

a_list = [
..........1,
..........2,
..........]

doesn't work for me. I prefer:

a_list = [
....1,
....2,
]

Having to manually dedent the closing bracket is okay, and after bringing the first line back it's fine, but having the first only indent by 4 (indent size) would be handy.

(Same for tuples, dicts and calls, obviously. Now how do I mark this "super-low priority"...)

comments

dinov wrote Oct 25, 2011 at 6:33 PM

This is the same behavior that PyCharm, PyDev, and WingWare have (at least by default). I'm reclassifying this as a feature because we should probably have some options relating to how formatting should happen, and then we should respect those options when doing auto-indent. See also http://pytools.codeplex.com/workitem/176

dinov wrote Oct 25, 2011 at 6:34 PM

Oh, by the "this is the same" I mean our current behavior, not the desired behavior.