end (but start and end inside of the buffer limits) for the last
empty row behind a newline.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18576
a592a061-630c-0410-9148-
cb99ea01b6c8
// Make sure that if a par ends in newline, there is one more row
// under it
// Make sure that if a par ends in newline, there is one more row
// under it
- // FIXME this is a dirty trick. Now the _same_ position in the
- // paragraph occurs in _two_ different rows, and has two different
- // display positions, leading to weird behaviour when moving up/down.
if (z > 0 && par.isNewline(z - 1)) {
if (z > 0 && par.isNewline(z - 1)) {
- Row row(z - 1);
- row.endpos(z - 1);
+ Row row(z);
+ row.endpos(z);
setRowWidth(right_margin, pit, row);
setHeightOfRow(pit, row);
pm.rows().push_back(row);
setRowWidth(right_margin, pit, row);
setHeightOfRow(pit, row);
pm.rows().push_back(row);
// The test on par.size() is to catch zero-size pars, which
// would trigger the assert in Paragraph::getInset().
//inset = par.size() ? par.getInset(row.pos()) : 0;
// The test on par.size() is to catch zero-size pars, which
// would trigger the assert in Paragraph::getInset().
//inset = par.size() ? par.getInset(row.pos()) : 0;
+ if (row.pos() < par.size()
&& par.isInset(row.pos()))
{
switch(par.getInset(row.pos())->display()) {
&& par.isInset(row.pos()))
{
switch(par.getInset(row.pos())->display()) {
if (pit == 0 && row.pos() == 0)
maxasc += 20;
if (pit + 1 == pit_type(pars.size()) &&
if (pit == 0 && row.pos() == 0)
maxasc += 20;
if (pit + 1 == pit_type(pars.size()) &&
- row.endpos() == par.size())
+ row.endpos() == par.size() &&
+ !(row.endpos() > 0 && par.isNewline(row.endpos() - 1)))