mod/maxgui.mod/fltkmaxgui.mod/src/Fl_Text_Display.cxx
int Fl_Text_Display::rewind_lines(int startPos, int nLines) {
  IS_UTF8_ALIGNED2(buffer(), startPos)

  Fl_Text_Buffer *buf = buffer();
  int pos, lineStart, retLines, retPos, retLineStart, retLineEnd;
  
  /* If we're not wrapping, use the more efficient BufCountBackwardNLines */
  if (!mContinuousWrap)
    return buf->rewind_lines(startPos, nLines);
  
  pos = startPos;
  for (;;) {
    lineStart = buf->line_start(pos);
    wrapped_line_counter(buf, lineStart, pos, INT_MAX, true, 0, 
                         &retPos, &retLines, &retLineStart, &retLineEnd, false);
    if (retLines > nLines)
      return skip_lines(lineStart, retLines-nLines, true);
    nLines -= retLines;
    pos = lineStart - 1;
    if (pos < 0)
      return 0;
    nLines -= 1;
  }
}
/**
 \brief Skip a number of lines back.
 
 Same as BufCountBackwardNLines, but takes in to account line breaks when
 wrapping is turned on.
 
 \param startPos index to starting character
 \param nLines number of lines to skip back
 \return new position as index
 */
\brief Skip a number of lines back.
Same as BufCountBackwardNLines, but takes in to account line breaks when
wrapping is turned on.

\param startPos index to starting character
\param nLines number of lines to skip back
\return new position as index
\ brief Skip a number of lines back . Same as BufCountBackwardNLines but takes in to account line breaks when wrapping is turned on . \ param startPos index to starting character \ param nLines number of lines to skip back \ return new position as index
int Fl_Text_Display::rewind_lines(int startPos, int nLines) {
  IS_UTF8_ALIGNED2(buffer(), startPos)
  Fl_Text_Buffer *buf = buffer();
  int pos, lineStart, retLines, retPos, retLineStart, retLineEnd;
  if (!mContinuousWrap)
    return buf->rewind_lines(startPos, nLines);
  pos = startPos;
  for (;;) {
    lineStart = buf->line_start(pos);
    wrapped_line_counter(buf, lineStart, pos, INT_MAX, true, 0, 
                         &retPos, &retLines, &retLineStart, &retLineEnd, false);
    if (retLines > nLines)
      return skip_lines(lineStart, retLines-nLines, true);
    nLines -= retLines;
    pos = lineStart - 1;
    if (pos < 0)
      return 0;
    nLines -= 1;
  }
}
int Fl_Text_Display :: rewind_lines ( int startPos , int nLines ) { IS_UTF8_ALIGNED2 ( buffer ( ) , startPos ) Fl_Text_Buffer * buf = buffer ( ) ; int pos , lineStart , retLines , retPos , retLineStart , retLineEnd ; if ( ! mContinuousWrap ) return buf -> rewind_lines ( startPos , nLines ) ; pos = startPos ; for ( ; ; ) { lineStart = buf -> line_start ( pos ) ; wrapped_line_counter ( buf , lineStart , pos , INT_MAX , true , 0 , & retPos , & retLines , & retLineStart , & retLineEnd , false ) ; if ( retLines > nLines ) return skip_lines ( lineStart , retLines - nLines , true ) ; nLines -= retLines ; pos = lineStart - 1 ; if ( pos < 0 ) return 0 ; nLines -= 1 ; } }
\brief Skip a number of lines back.
\ brief Skip a number of lines back .
/* If we're not wrapping, use the more efficient BufCountBackwardNLines */