#932 Space after bracket handled unconsistently by Format Code

1.4.6
closed-fixed
nobody
None
5
2009-07-07
2009-06-16
No

Unary operators are handled differently compared to numbers/names when appearing right after opening square/curly bracket. In the following example the "use space before and after parenthesis?" option is selected:

t1 = ( 1, )
t2 = ( -1, )
l1 = [ 1 ]
l2 = [ -1 ]
d1 = { 1:0 }
d2 = { -1:0 }

When doing Ctrl-Shift-F for "Format Code" the above code turns into:

t1 = ( 1, )
t2 = ( -1, )
l1 = [ 1 ]
l2 = [-1 ]
d1 = { 1:0 }
d2 = {-1:0 }

Ultimately I would like two more options for the "Format Code" to be able to force spaces before and after square/curly braces just like it is for parentheses now. This is however a feature request, so in the mean time I would settle with the formatter to let the spaces that I have written to remain after "Format Code", just like it is for the non-operator characters.

I'm currently running Eclipse 3.4.2 together with pydev 1.4.6.

Discussion

  • Fabio Zadrozny

    Fabio Zadrozny - 2009-07-07

    Fixed the bug for 1.4.7 (svn: 2842) please open a feature request for the spaces after/before square curly braces.

    Cheers,

    Fabio

     
  • Fabio Zadrozny

    Fabio Zadrozny - 2009-07-07
    • status: open --> closed-fixed
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks