Package com.intellij.openapi.editor.highlighter

Examples of com.intellij.openapi.editor.highlighter.HighlighterIterator.atEnd()


      result.addElement(TailTypeDecorator.withTail(LookupElementBuilder.create(s.getName()).
        withCaseSensitivity(false), new TailType() {
        public int processTail(Editor editor, int tailOffset) {
          HighlighterIterator iterator = ((EditorEx)editor).getHighlighter().createIterator(tailOffset);
          if (!iterator.atEnd() && iterator.getTokenType() == CfmlTokenTypes.WHITE_SPACE) iterator.advance();
          if (!iterator.atEnd() && iterator.getTokenType() == CfmlTokenTypes.ASSIGN) {
            iterator.advance();
          }
          else {
            editor.getDocument().insertString(tailOffset, "=\"\"");
            return moveCaret(editor, tailOffset, 2);
View Full Code Here


          else {
            editor.getDocument().insertString(tailOffset, "=\"\"");
            return moveCaret(editor, tailOffset, 2);
          }
          int offset = iterator.getStart();
          if (!iterator.atEnd() && iterator.getTokenType() == CfmlTokenTypes.WHITE_SPACE) iterator.advance();
          if (!iterator.atEnd() && CfmlTokenTypes.STRING_ELEMENTS.contains(iterator.getTokenType())) {
            return tailOffset;
          }

          editor.getDocument().insertString(offset, "\"\"");
View Full Code Here

            editor.getDocument().insertString(tailOffset, "=\"\"");
            return moveCaret(editor, tailOffset, 2);
          }
          int offset = iterator.getStart();
          if (!iterator.atEnd() && iterator.getTokenType() == CfmlTokenTypes.WHITE_SPACE) iterator.advance();
          if (!iterator.atEnd() && CfmlTokenTypes.STRING_ELEMENTS.contains(iterator.getTokenType())) {
            return tailOffset;
          }

          editor.getDocument().insertString(offset, "\"\"");
          return moveCaret(editor, tailOffset, offset - tailOffset + 1);
View Full Code Here

    HighlighterIterator iterator = ((EditorEx) editor).getHighlighter().createIterator(offset);
    boolean atEndOfDocument = offset == editor.getDocument().getTextLength();

    if (offset == 0) return false;
    if (!atEndOfDocument) iterator.retreat();
    if (iterator.atEnd()) return false;

    PsiElement elementAt = file.findElementAt(offset - 1);
    if (elementAt == null || elementAt.getNode().getElementType() != ErlangTypes.ERL_SEMI) return false;
    ASTNode sibling = FormatterUtil.getPreviousNonWhitespaceSibling(elementAt.getNode());
    if (sibling == null) return false;
View Full Code Here

    int offset = editor.getCaretModel().getOffset();
    HighlighterIterator iterator = ((EditorEx) editor).getHighlighter().createIterator(offset);
    boolean atEndOfDocument = offset == editor.getDocument().getTextLength();

    if (!atEndOfDocument) iterator.retreat();
    if (iterator.atEnd()) return;
    BraceMatcher braceMatcher = BraceMatchingUtil.getBraceMatcher(fileType, iterator);
    if (iterator.atEnd()) return;
    IElementType braceTokenType = iterator.getTokenType();
    CharSequence fileText = editor.getDocument().getCharsSequence();
    if (!braceMatcher.isLBraceToken(iterator, fileText, fileType)) return;
View Full Code Here

    boolean atEndOfDocument = offset == editor.getDocument().getTextLength();

    if (!atEndOfDocument) iterator.retreat();
    if (iterator.atEnd()) return;
    BraceMatcher braceMatcher = BraceMatchingUtil.getBraceMatcher(fileType, iterator);
    if (iterator.atEnd()) return;
    IElementType braceTokenType = iterator.getTokenType();
    CharSequence fileText = editor.getDocument().getCharsSequence();
    if (!braceMatcher.isLBraceToken(iterator, fileText, fileType)) return;

    if (!iterator.atEnd()) {
View Full Code Here

    if (iterator.atEnd()) return;
    IElementType braceTokenType = iterator.getTokenType();
    CharSequence fileText = editor.getDocument().getCharsSequence();
    if (!braceMatcher.isLBraceToken(iterator, fileText, fileType)) return;

    if (!iterator.atEnd()) {
      iterator.advance();

      if (!iterator.atEnd()) {
        if (!BraceMatchingUtil.isPairedBracesAllowedBeforeTypeInFileType(braceTokenType, iterator.getTokenType(), fileType)) {
          return;
View Full Code Here

    if (!braceMatcher.isLBraceToken(iterator, fileText, fileType)) return;

    if (!iterator.atEnd()) {
      iterator.advance();

      if (!iterator.atEnd()) {
        if (!BraceMatchingUtil.isPairedBracesAllowedBeforeTypeInFileType(braceTokenType, iterator.getTokenType(), fileType)) {
          return;
        }
        if (BraceMatchingUtil.isLBraceToken(iterator, fileText, fileType)) {
          return;
View Full Code Here

        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;
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.