Alfredo Braunstein wrote:

> I've implemented a simple, standalone PosIterator, that iterates
> over cursor positions in a document (i.e. valid char positions +
> paragraph ends). I've made this in principle beacuse it would make
> trivial to fix find & replace for instance.
> 
> Now, I understand that this is more or less what a "global cursor"
> would do, but in my humble understanding (and I mean that "humble"):
> 
>         - this seems to work now
>         - it is completely standalone (no Textcursor, no bv, rows,
>         dispatch or whatever... nothing. And so terribly simple). In
>         other words, it doesn't have the burden of acting
>         transitionally as a lyx cursor. - it uses no paroffsets, and
>         thus may be faster. it is completely non-stable: works on
>         static text only.
> 
> Even if some or all of the above are right/wrong, I still cannot
> make my mind if this can be useful at all (aside Cursor, or as a
> transitional thing). As I changed view a few times in the last
> hours, I'though I'd better post it here and ask for comments. And so
> I'm doing.

I think that this is fantastic. Truly it is great to know someone who 
can turn the complex into the simple. You did it to the code in 
src/graphics and now you do it to the can of worms that is the LyX 
core. Bravo!

I can even follow the code. I think ;-)

So now the difficult question: what is wrong with it? Why does it 
work only with static text? Presumably that is because any one of the 
four data members in PosIteratorItem can be invalidated by the 
insertion/deletion of text, of insets or indeed of paragraphs, right?

So, how do you envisage keeping the data valid?

-- 
Angus

Reply via email to