Lars Gullik Bjønnes wrote:
Abdelrazak Younes <[EMAIL PROTECTED]> writes:
| Lars Gullik Bjønnes wrote:
| > Abdelrazak Younes <[EMAIL PROTECTED]> writes:
| > | Peter Kümmel wrote:
| > | | > A other solution is to somehow handle within the views which
| > part
| > | > of the buffer is viewed.
| > | | This is what we have already: Each LyXView (WorkArea really) has
| > its
| > | own unique BufferView which is a view of one part of the document.
| > | Except for some cursor bug (the famous dEPM bug), this is working fine.
| > ..except that metrics is shared between views.
|
| This should not be. Each BufferView now has its own CoordCache. If
| there's still something shared, this should be fixed.
|
|
| > (And this fails miserably when the windows are of different widths.)
|
| The problem is different here. I believe that there's some cursor
| interaction problem that leads. This leads to crashes but most of the
| time, if you have two BufferView sharing the same Buffer, changing the
| geometry of one does not impact the other one (except if there's some
| editing that invalidated the cursor of the other BufferView).
Just try it for yourself and you will see.
As I said, the problem is not related to metrics but to a bad paragraph
model. More exactly this (in paragraph.h):
/// LyXText updates the rows using this access point
RowList & rows() { return rows_; }
/// The painter and others use this
RowList const & rows() const { return rows_; }
This is really, really _wrong_, a paragraph should not have any notion
of rows. By modifying the geometry of the windows (the BufferView) you
also modify the model (the Buffer) because the rows() information is not
valid any more.
rows is a RowList, that is a vector of row:
/**
* Each paragraph is broken up into a number of rows on the screen.
* This is a list of such on-screen rows, ordered from the top row
* downwards.
*/
typedef std::vector<Row> RowList;
Georg is right, the LyX core is not ready for Multiple-view. There's too
much that needs to be re-designed. So either someone steps up and
cleanup that mess by putting the rows calculation outside of the Buffer
or we disable the multi-windows feature.
Abdel.