- // treat floats, HFills and Insets as words
- LyXCursor tmpcursor = cursor;
- // CHECK See comment on top of text.C
-
- if (tmpcursor.pos() == tmpcursor.par()->size()
- && tmpcursor.par()->next()) {
- tmpcursor.par(tmpcursor.par()->next());
- tmpcursor.pos(0);
- } else {
- int steps = 0;
-
- // Skip through initial nonword stuff.
- while (tmpcursor.pos() < tmpcursor.par()->size() &&
- ! tmpcursor.par()->isWord(tmpcursor.pos())) {
- // printf("Current pos1 %d", tmpcursor.pos()) ;
- tmpcursor.pos(tmpcursor.pos() + 1);
- ++steps;
- }
- // Advance through word.
- while (tmpcursor.pos() < tmpcursor.par()->size() &&
- tmpcursor.par()->isWord(tmpcursor.pos())) {
- // printf("Current pos2 %d", tmpcursor.pos()) ;
- tmpcursor.pos(tmpcursor.pos() + 1);
- ++steps;
- }
- }
- setCursor(bview, tmpcursor.par(), tmpcursor.pos());
-}
-
-
-void LyXText::cursorTab(BufferView * bview) const
-{
- LyXCursor tmpcursor = cursor;
- while (tmpcursor.pos() < tmpcursor.par()->size()
- && !tmpcursor.par()->isNewline(tmpcursor.pos()))
- tmpcursor.pos(tmpcursor.pos() + 1);
-
- if (tmpcursor.pos() == tmpcursor.par()->size()) {
- if (tmpcursor.par()->next()) {
- tmpcursor.par(tmpcursor.par()->next());
- tmpcursor.pos(0);
- }
- } else
- tmpcursor.pos(tmpcursor.pos() + 1);
- setCursor(bview, tmpcursor.par(), tmpcursor.pos());