Logo Search packages:      
Sourcecode: jedit version File versions  Download package

void org::gjt::sp::jedit::textarea::TextArea::goToNextParagraph ( boolean  select  )  [inline]

Moves the caret to the start of the next paragraph.

Parameters:
select true if you want to extend selection
Since:
jEdit 2.7pre2

Definition at line 2516 of file TextArea.java.

References extendSelection(), getBufferLength(), getCaretLine(), getLineCount(), getLineStartOffset(), getLineText(), org::gjt::sp::jedit::textarea::DisplayManager::isLineVisible(), moveCaretPosition(), multi, and selectNone().

      {
            int lineNo = getCaretLine();

            int newCaret = getBufferLength();

            boolean foundBlank = false;

loop:       for(int i = lineNo + 1; i < getLineCount(); i++)
            {
                  if(!displayManager.isLineVisible(i))
                        continue;

                  getLineText(i,lineSegment);

                  for(int j = 0; j < lineSegment.count; j++)
                  {
                        switch(lineSegment.array[lineSegment.offset + j])
                        {
                        case ' ':
                        case '\t':
                              break;
                        default:
                              if(foundBlank)
                              {
                                    newCaret = getLineStartOffset(i);
                                    break loop;
                              }
                              else
                                    continue loop;
                        }
                  }

                  foundBlank = true;
            }

            if(select)
                  extendSelection(caret,newCaret);
            else if(!multi)
                  selectNone();
            moveCaretPosition(newCaret);
      } //}}}


Generated by  Doxygen 1.6.0   Back to index