Package org.python.pydev.core.docutils

Examples of org.python.pydev.core.docutils.PythonPairMatcher.match()


                //we have to check if smartIndent is -1 because otherwise we are inside some bracket
                if (smartIndent == -1 && !isInsidePar && StringUtils.isClosingPeer(lastChar)) {
                    //ok, not inside brackets
                    PythonPairMatcher matcher = new PythonPairMatcher(StringUtils.BRACKETS);
                    int bracketOffset = selection.getLineOffset() + curr;
                    IRegion region = matcher.match(document, bracketOffset + 1);
                    if (region != null) {
                        if (!PySelection.endsInSameLine(document, region)) {
                            //we might not have a match if there is an error in the program...
                            //e.g. a single ')' without its counterpart.
                            int openingBracketLine = document.getLineOfOffset(region.getOffset());
View Full Code Here


                //no more closing peers there, ok to go
                return true;
            }

            //the +1 is needed because we match closing ones that are right before the current cursor
            IRegion match = matcher.match(ps.getDoc(), closingPeerFoundAtOffset + 1);
            if (match == null) {
                //we don't have a match for a close, so, this open is that match.
                return false;
            }
View Full Code Here

            boolean opening = StringUtils.isOpeningPeer(c);
            boolean closing = StringUtils.isClosingPeer(c);

            if (opening || closing) {
                PythonPairMatcher matcher = new PythonPairMatcher();
                IRegion match = matcher.match(doc, ps.getAbsoluteCursorOffset());
                if (match != null) {
                    if (closing) {
                        pyEdit.setSelection(match.getOffset() + 1, 0);
                    } else {//opening
                        pyEdit.setSelection(match.getOffset() + match.getLength(), 0);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.