Andre Poenitz wrote: >> +void BufferView::setCursor(ParIterator const & par, >> + lyx::pos_type pos) >> +{ >> + LCursor & cur = cursor(); >> + cur.reset(); >> + ParIterator::PosHolder const & positions = par.positions(); >> + int const last = par.size() - 1; >> + for (int i = 0; i < last; ++i) >> + (*positions[i].it)->inset->edit(cur, true); >> + cur.resetAnchor(); >> + LyXText * lt = par.text(*buffer()); >> + lt->setCursor(par.pit(), pos); >> +} > > I wonder whether an CursorBase could replace that ParIterator/pos_type > combo at some point of time...
Agreed... in fact we have three "equivalent but separate" structures now: ParIterator, PosIterator and CursorBase that we should merge somehow. But I don't think it's critical now, and it will be somehow automatic once we set up for the good one... > [Btw: An assert in LyXText::cursor() already crashes on File->New. > I wonder whether there ever was some non-chaotic system for the order of > initializing things in this area...] ;-) Alfredo