Package com.intellij.openapi.editor.highlighter

Examples of com.intellij.openapi.editor.highlighter.HighlighterIterator


        }
        //offset can be changed after text trimming after insert due to buffer constraints
        appendToHistoryDocument(history, text);
        int offset = history.getTextLength() - text.length();

        final HighlighterIterator iterator = highlighter.createIterator(localStartOffset);
        final int localEndOffset = textRange.getEndOffset();
        while (!iterator.atEnd()) {
            final int itStart = iterator.getStart();
            if (itStart > localEndOffset) break;
            final int itEnd = iterator.getEnd();
            if (itEnd >= localStartOffset) {
                final int start = Math.max(itStart, localStartOffset) - localStartOffset + offset;
                final int end = Math.min(itEnd, localEndOffset) - localStartOffset + offset;
                markupModel.addRangeHighlighter(start, end, HighlighterLayer.SYNTAX, iterator.getTextAttributes(),
                        HighlighterTargetArea.EXACT_RANGE);
            }
            iterator.advance();
        }
        if (!text.endsWith("\n")) {
            appendToHistoryDocument(history, "\n");
        }
        return text;
View Full Code Here

TOP

Related Classes of com.intellij.openapi.editor.highlighter.HighlighterIterator

Copyright © 2018 www.massapicom. 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.