Fix bug 7673 by reverting changes to BufferView::checkDepm

This reverts commit 210a4406 and a part of 5577e877.
This commit is contained in:
Vincent van Ravesteijn 2013-05-19 14:42:27 +02:00
parent 1c362cc773
commit 97405fa623
5 changed files with 11 additions and 34 deletions

View File

@ -2400,9 +2400,12 @@ bool BufferView::checkDepm(Cursor & cur, Cursor & old)
return false; return false;
d->cursor_ = cur; d->cursor_ = cur;
// we would rather not do this here, but it needs to be done before
// the changed() signal is sent.
buffer_.updateBuffer();
cur.forceBufferUpdate(); buffer_.changed(true);
cur.screenUpdateFlags(Update::Force);
return true; return true;
} }

View File

@ -2048,12 +2048,8 @@ bool Cursor::upDownInText(bool up, bool & updateNeeded)
updateNeeded |= bv().checkDepm(dummy, *this); updateNeeded |= bv().checkDepm(dummy, *this);
updateTextTargetOffset(); updateTextTargetOffset();
if (updateNeeded) { if (updateNeeded)
forceBufferUpdate(); forceBufferUpdate();
// DEPM may have requested a screen update
this->screenUpdateFlags(
this->screenUpdate() | dummy.screenUpdate());
}
} }
return false; return false;
} }
@ -2078,8 +2074,7 @@ bool Cursor::upDownInText(bool up, bool & updateNeeded)
++dummy.pos(); ++dummy.pos();
if (bv().checkDepm(dummy, old)) { if (bv().checkDepm(dummy, old)) {
updateNeeded = true; updateNeeded = true;
// Make sure that cur gets back whatever happened to dummy (Lgb) // Make sure that cur gets back whatever happened to dummy (Lgb)
// This will include any screen update requested by DEPM
operator=(dummy); operator=(dummy);
} }
} else { } else {

View File

@ -297,8 +297,6 @@ public:
* Not using noScreenUpdate() should never be wrong. * Not using noScreenUpdate() should never be wrong.
*/ */
void noScreenUpdate() const; void noScreenUpdate() const;
///
Update::flags screenUpdate() const { return disp_.screenUpdate(); }
/// fix cursor in circumstances that should never happen. /// fix cursor in circumstances that should never happen.
/// \retval true if a fix occured. /// \retval true if a fix occured.
bool fixIfBroken(); bool fixIfBroken();

View File

@ -551,9 +551,6 @@ bool Text::setCursor(Cursor & cur, pit_type par, pos_type pos,
bool const update_needed = !tm.contains(par); bool const update_needed = !tm.contains(par);
Cursor old = cur; Cursor old = cur;
setCursorIntern(cur, par, pos, setfont, boundary); setCursorIntern(cur, par, pos, setfont, boundary);
// FIXME There is a chance that we'll miss a screen update here.
// If so, then do DEPM and then check if cur wants an update and
// go ahead and do it, if so.
return cur.bv().checkDepm(cur, old) || update_needed; return cur.bv().checkDepm(cur, old) || update_needed;
} }

View File

@ -648,12 +648,8 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
// provide it with two different cursors. // provide it with two different cursors.
Cursor dummy = cur; Cursor dummy = cur;
dummy.pos() = dummy.pit() = 0; dummy.pos() = dummy.pit() = 0;
if (cur.bv().checkDepm(dummy, cur)) { if (cur.bv().checkDepm(dummy, cur))
cur.forceBufferUpdate(); cur.forceBufferUpdate();
// DEPM may have requested a screen update
cur.screenUpdateFlags(
cur.screenUpdate() | dummy.screenUpdate());
}
} }
} }
break; break;
@ -679,12 +675,8 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
Cursor dummy = cur; Cursor dummy = cur;
dummy.pos() = cur.lastpos(); dummy.pos() = cur.lastpos();
dummy.pit() = cur.lastpit(); dummy.pit() = cur.lastpit();
if (cur.bv().checkDepm(dummy, cur)) { if (cur.bv().checkDepm(dummy, cur))
cur.forceBufferUpdate(); cur.forceBufferUpdate();
// DEPM may have requested a screen update
cur.screenUpdateFlags(
cur.screenUpdate() | dummy.screenUpdate());
}
} }
} }
break; break;
@ -867,12 +859,8 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
// provide it with two different cursors. // provide it with two different cursors.
Cursor dummy = cur; Cursor dummy = cur;
dummy.pos() = dummy.pit() = 0; dummy.pos() = dummy.pit() = 0;
if (cur.bv().checkDepm(dummy, cur)) { if (cur.bv().checkDepm(dummy, cur))
cur.forceBufferUpdate(); cur.forceBufferUpdate();
// DEPM may have requested a screen update
cur.screenUpdateFlags(
cur.screenUpdate() | dummy.screenUpdate());
}
} }
} }
break; break;
@ -921,12 +909,8 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
Cursor dummy = cur; Cursor dummy = cur;
dummy.pos() = cur.lastpos(); dummy.pos() = cur.lastpos();
dummy.pit() = cur.lastpit(); dummy.pit() = cur.lastpit();
if (cur.bv().checkDepm(dummy, cur)) { if (cur.bv().checkDepm(dummy, cur))
cur.forceBufferUpdate(); cur.forceBufferUpdate();
// DEPM may have requested a screen update
cur.screenUpdateFlags(
cur.screenUpdate() | dummy.screenUpdate());
}
} }
} }
break; break;