[Pydev-cvs] org.python.pydev/src/org/python/pydev/editor/actions PyFormatStd.java,1.1,1.2
Brought to you by:
fabioz
|
From: Fabio Z. <fa...@us...> - 2005-02-24 17:44:38
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/actions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28554/src/org/python/pydev/editor/actions Modified Files: PyFormatStd.java Log Message: formatting improved Index: PyFormatStd.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/actions/PyFormatStd.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PyFormatStd.java 23 Feb 2005 14:29:36 -0000 1.1 --- PyFormatStd.java 24 Feb 2005 17:44:12 -0000 1.2 *************** *** 127,136 **** StringBuffer locBuf = new StringBuffer(); - //check that, otherwise, we get 2 spaces (so we don't break the rule... and treat the exception as exception) - if(cs[i+1] == ')'){ - buf.append( "( )" ); - return i+1; - } - int j = i+1; while(j < cs.length && (c = cs[j]) != ')'){ --- 127,130 ---- *************** *** 148,159 **** if(c == ')'){ ! if(std.parametersWithSpace){ ! buf.append( "( " ); ! buf.append( formatStr(locBuf.toString().trim(), std) ); ! buf.append( " )" ); }else{ buf.append( "(" ); ! buf.append( formatStr(locBuf.toString().trim(), std) ); buf.append( ")" ); } --- 142,160 ---- if(c == ')'){ ! String formatStr = formatStr(locBuf.toString().trim(), std); ! formatStr = formatStr.trim(); ! if(std.parametersWithSpace){ ! if(formatStr.length() == 0){ ! buf.append( "( )" ); ! ! }else{ ! buf.append( "( " ); ! buf.append( formatStr ); ! buf.append( " )" ); ! } }else{ buf.append( "(" ); ! buf.append( formatStr ); buf.append( ")" ); } |