[Pydev-cvs] org.python.pydev/src/org/python/pydev/editor/autoedit PyAutoIndentStrategy.java, 1.65,
Brought to you by:
fabioz
From: Fabio Z. <fa...@us...> - 2008-03-24 15:57:40
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/autoedit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32343/src/org/python/pydev/editor/autoedit Modified Files: PyAutoIndentStrategy.java Log Message: Messages and fixes for close parenthesis Index: PyAutoIndentStrategy.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/autoedit/PyAutoIndentStrategy.java,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** PyAutoIndentStrategy.java 18 Mar 2008 02:55:17 -0000 1.65 --- PyAutoIndentStrategy.java 24 Mar 2008 15:57:45 -0000 1.66 *************** *** 17,20 **** --- 17,21 ---- import org.python.pydev.core.docutils.DocUtils; import org.python.pydev.core.docutils.ImportsSelection; + import org.python.pydev.core.docutils.NoPeerAvailableException; import org.python.pydev.core.docutils.ParsingUtils; import org.python.pydev.core.docutils.PySelection; *************** *** 754,767 **** char c = ps.getCharAtCurrentOffset(); ! char peer = DocUtils.getPeer(c); ! StringBuffer doc = new StringBuffer(document.get()); ! //it is not enough just counting the chars, we have to ignore those that are within comments or literals. ! ParsingUtils.removeCommentsWhitespacesAndLiterals(doc); ! int chars = PyAction.countChars(c, doc); ! int peers = PyAction.countChars(peer, doc); ! ! boolean skipChar = chars == peers; ! return skipChar; } /** --- 755,775 ---- char c = ps.getCharAtCurrentOffset(); ! ! try{ ! char peer = DocUtils.getPeer(c); ! ! StringBuffer doc = new StringBuffer(document.get()); ! //it is not enough just counting the chars, we have to ignore those that are within comments or literals. ! ParsingUtils.removeCommentsWhitespacesAndLiterals(doc); ! int chars = PyAction.countChars(c, doc); ! int peers = PyAction.countChars(peer, doc); ! ! boolean skipChar = chars == peers; ! return skipChar; ! }catch(NoPeerAvailableException e){ ! return false; ! } } + /** |